4 #define SECTSIZE 512 // bytes per disk sector
5 #define BLKSECTS (BLKSIZE / SECTSIZE) // sectors per block
7 /* Disk block n, when in memory, is mapped into the file system
8 * server's address space at DISKMAP + (n*BLKSIZE). */
9 #define DISKMAP 0x10000000
11 /* Maximum disk size we can handle (3GB) */
12 #define DISKSIZE 0xC0000000
15 bool ide_probe_disk1(void);
16 void ide_set_disk(int diskno
);
17 int ide_read(uint32_t secno
, void *dst
, size_t nsecs
);
18 int ide_write(uint32_t secno
, const void *src
, size_t nsecs
);
21 int file_create(const char *path
, struct File
**f
);
22 int file_open(const char *path
, struct File
**f
);
23 int file_get_block(struct File
*f
, uint32_t file_blockno
, char **pblk
);
24 int file_set_size(struct File
*f
, off_t newsize
);
25 void file_flush(struct File
*f
);
26 void file_close(struct File
*f
);
27 int file_remove(const char *path
);
29 int file_dirty(struct File
*f
, off_t offset
);
32 extern uint32_t *bitmap
;
33 int map_block(uint32_t);
34 int alloc_block(void);