/* Allocate data sector(s) for the free map file
and write its file header to disk. */
- map_hdr = filehdr_allocate (&free_map, bitmap_storage_size (&free_map));
+ map_hdr = filehdr_allocate (&free_map, bitmap_file_size (&free_map));
if (map_hdr == NULL)
PANIC ("free map creation failed--disk is too large");
filehdr_write (map_hdr, FREE_MAP_SECTOR);
void
filesys_init (bool format)
{
- filesys_disk = disk_get (1);
+ filesys_disk = disk_get (0, 1);
if (filesys_disk == NULL)
- PANIC ("ide1:1 not present, filesystem initialization failed");
+ PANIC ("hd0:1 (hdb) not present, filesystem initialization failed");
if (format)
do_format ();
{
struct dir dir;
struct bitmap free_map;
- disk_sector_no hdr_sector;
+ disk_sector_t hdr_sector;
struct filehdr *filehdr;
bool success = false;
filesys_open (const char *name, struct file *file)
{
struct dir dir;
- disk_sector_no hdr_sector;
+ disk_sector_t hdr_sector;
bool success = false;
if (!dir_init (&dir, NUM_DIR_ENTRIES))
filesys_remove (const char *name)
{
struct dir dir;
- disk_sector_no hdr_sector;
+ disk_sector_t hdr_sector;
struct filehdr *filehdr;
struct bitmap free_map;
bool success = false;