35 lines
1.5 KiB
C
35 lines
1.5 KiB
C
|
#ifndef RK_FAT12_H_
|
||
|
#define RK_FAT12_H_
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
struct fat12_boot_sector {
|
||
|
uint8_t jump_boot[3]; // Jump instruction to boot code
|
||
|
uint8_t oem_name[8]; // OEM name and version
|
||
|
uint16_t bytes_per_sector; // Bytes per sector
|
||
|
uint8_t sectors_per_cluster; // Sectors per cluster
|
||
|
uint16_t reserved_sectors; // Reserved sectors
|
||
|
uint8_t num_fats; // Number of FATs
|
||
|
uint16_t root_entry_count; // Number of root directory entries
|
||
|
uint16_t total_sectors_16; // Total sectors (16-bit)
|
||
|
uint8_t media; // Media descriptor
|
||
|
uint16_t fat_size_16; // Sectors per FAT (16-bit)
|
||
|
uint16_t sectors_per_track; // Sectors per track (for BIOS)
|
||
|
uint16_t num_heads; // Number of heads (for BIOS)
|
||
|
uint32_t hidden_sectors; // Hidden sectors
|
||
|
uint32_t total_sectors_32; // Total sectors (32-bit)
|
||
|
|
||
|
// Extended Boot Record (EBR) fields
|
||
|
uint8_t drive_number; // Drive number
|
||
|
uint8_t reserved1; // Reserved
|
||
|
uint8_t boot_signature; // Extended boot signature
|
||
|
uint32_t volume_id; // Volume ID (serial number)
|
||
|
uint8_t volume_label[11]; // Volume label
|
||
|
uint8_t file_system_type[8]; // File system type (e.g., "FAT12 ")
|
||
|
|
||
|
uint8_t boot_code[448]; // Boot code
|
||
|
uint16_t boot_sector_signature; // Boot sector signature (0xAA55)
|
||
|
} __attribute__((packed));
|
||
|
|
||
|
#endif
|