26static u8 fat16_sector[512];
43 u32 root_dir_sectors =
73 if (*(
u16 *)&fat16_sector[510] != 0xAA55) {
74 Kprintf(
"Invalid FAT16 boot sector signature\n");
92 u32 root_dir_sectors =
96 fat16.root_dir_start_lba =
98 fat16.data_start_lba =
fat16.root_dir_start_lba + root_dir_sectors;
102 Kprintf(
"FAT16 Mount Success:\n");
104 Kprintf(
" Root Dir LBA: %x\n",
fat16.root_dir_start_lba);
void AtaReadSector(u32 lba, u8 *buffer)
Read a single 512-byte sector from the ATA device using LBA addressing.
u32 Fat16TotalClusters(struct FaT16Info *fat)
Calculate the total number of data clusters in a FAT16 filesystem.
struct FaT16Info fat16
Holds FAT16 filesystem info and a sector buffer.
u32 Fat16Mount(u32 partition_lba)
Mounts the FAT16 filesystem from a given partition LBA.
Definitions and declarations for FAT16 filesystem and ATA I/O.
void Kprintf(const char *fmt,...)
Formatted output to the screen.
unsigned int u32
32-Bit Unsigned Int
unsigned short u16
16-Bit Unsigned Int
unsigned char u8
8-Bit Unsigned Int
FAT16 BIOS Parameter Block (BPB) structure — describes volume layout.
Parsed FAT16 filesystem layout and parameters.