From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:FAT (FAT12, FAT16, FAT32, VFAT)" |
|---|
| claim | "The FAT boot sector as Linux declares it: common BPB at 0x0B-0x23, then at 0x24 either the FAT12/16 extension (drive number, state, signature, volume id, label, fs type; ends at 0x3E) or the FAT32 extension (32-bit FAT size, flags, version, root cluster, FSInfo and backup sector numbers, 12 reserved bytes, then the same drive number to fs type fields at 0x40; ends at 0x5A)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:FAT (FAT12, FAT16, FAT32, VFAT)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "fat_boot_sector" |
|---|
| endianness | "little" |
|---|
| fields | | offset | "0x00" |
|---|
| size | 3 |
|---|
| type | "uint8_t[3]" |
|---|
| name | "jump" |
|---|
|
| offset | "0x03" |
|---|
| size | 8 |
|---|
| type | "char[8]" |
|---|
| name | "system_id" |
|---|
|
| offset | "0x0B" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "bytes_per_sector" |
|---|
| notes | "unaligned; Linux declares it __u8[2]" |
|---|
|
| offset | "0x0D" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "sec_per_clus" |
|---|
|
| offset | "0x0E" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "reserved" |
|---|
|
| offset | "0x10" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fats" |
|---|
|
| offset | "0x11" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "dir_entries" |
|---|
|
| offset | "0x13" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "sectors" |
|---|
|
| offset | "0x15" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "media" |
|---|
|
| offset | "0x16" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "fat_length" |
|---|
|
| offset | "0x18" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "secs_track" |
|---|
|
| offset | "0x1A" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "heads" |
|---|
|
| offset | "0x1C" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "hidden" |
|---|
|
| offset | "0x20" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "total_sect" |
|---|
| notes | "used if sectors == 0" |
|---|
|
| offset | "0x24" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat16_drive_number" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x25" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat16_state" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x26" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat16_signature" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x27" |
|---|
| size | 4 |
|---|
| type | "uint8_t[4]" |
|---|
| name | "fat16_vol_id" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x2B" |
|---|
| size | 11 |
|---|
| type | "char[11]" |
|---|
| name | "fat16_vol_label" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x36" |
|---|
| size | 8 |
|---|
| type | "char[8]" |
|---|
| name | "fat16_fs_type" |
|---|
| condition | "FAT12/16" |
|---|
|
| offset | "0x24" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "fat32_length" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x28" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "fat32_flags" |
|---|
| condition | "FAT32 only" |
|---|
| notes | "bit 8: FAT mirroring, low 4 bits: active FAT" |
|---|
|
| offset | "0x2A" |
|---|
| size | 2 |
|---|
| type | "uint8_t[2]" |
|---|
| name | "fat32_version" |
|---|
| condition | "FAT32 only" |
|---|
| notes | "major, minor" |
|---|
|
| offset | "0x2C" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "fat32_root_cluster" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x30" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "fat32_info_sector" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x32" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "fat32_backup_boot" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x34" |
|---|
| size | 12 |
|---|
| type | "uint16_t[6]" |
|---|
| name | "fat32_reserved2" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x40" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat32_drive_number" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x41" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat32_state" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x42" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "fat32_signature" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x43" |
|---|
| size | 4 |
|---|
| type | "uint8_t[4]" |
|---|
| name | "fat32_vol_id" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x47" |
|---|
| size | 11 |
|---|
| type | "char[11]" |
|---|
| name | "fat32_vol_label" |
|---|
| condition | "FAT32 only" |
|---|
|
| offset | "0x52" |
|---|
| size | 8 |
|---|
| type | "char[8]" |
|---|
| name | "fat32_fs_type" |
|---|
| condition | "FAT32 only" |
|---|
|
|
|---|
| size_min | "0x3E" |
|---|
| size_max | "0x5A" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "struct fat_boot_sector; offsets computed from field sizes (sector_size is __u8[2] because it is unaligned)" |
|---|
| repo | "torvalds/linux" |
|---|
| commit | "c03c1a14507dfaf8b856c2608f9ac216021fc222" |
|---|
| path | "include/uapi/linux/msdos_fs.h" |
|---|
| lines | "108-161" |
|---|
|
| type | "source" |
|---|
| detail | "struct fat_boot_sector union { fat16 {...}; fat32 {length, flags, version, root_cluster, info_sector, backup_boot, reserved2[6], drive_number...fs_type} }; MSDOS_NAME is 11" |
|---|
| repo | "torvalds/linux" |
|---|
| commit | "c03c1a14507dfaf8b856c2608f9ac216021fc222" |
|---|
| path | "include/uapi/linux/msdos_fs.h" |
|---|
| lines | "108-161" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Boot sector BPB" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T06:21:48.192Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:49:52.529Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read struct fat_boot_sector in include/uapi/linux/msdos_fs.h lines 108-161: common BPB to 0x24, union of fat16 (ends 0x3E) and fat32 (length, flags, version, root_cluster, info_sector, backup_boot, reserved2[6], then drive_number..fs_type from 0x40, ends 0x5A). Offsets match. Note the 'bit 8: fat mirroring' wording is Linux's own comment (the on-disk mirroring-disabled flag is usually documented as bit 7)." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T08:04:44.478Z" |
|---|
| summary | "add the FAT12/16 extended BPB variant (declared only the FAT32 one), the FAT32 flags/version/reserved fields and the extended fields after them; the 0x5A size is the FAT32 form, FAT12/16 ends at 0x3E" |
|---|
| changed | | "claim" |
| "data" |
| "evidence" |
|
|---|
|
|
|---|