Microsoft's design for version 7.0 BIOS Parameter Blocks was a botched job that broke what had been, until then, a useful invariant that made it simple to determine what version BPB was being used. This is how version 7.0 BPBs should have been designed. It preserves the following invariant:
The way to determine what type of BPB is present in a volume's boot block is to inspect the value of the BPB signature field at offset 0x26.
offset from start of boot block | width in octets | description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
0x0B | 25 | |||||||||||
0x24 | 1 |
Disc unit number Same as the field at 0x24 in the MS/PC-DOS version 4.0 BPB |
||||||||||
0x25 | 1 |
"chkdsk" flags Same as the field at 0x25 in the MS/PC-DOS version 4.0 BPB |
||||||||||
0x26 | 1 |
Signature byte The value 70 (0x46) in this field indicates that this is an MS/PC-DOS version 7.0 BPB. Other values indicate other BPB variants, such as the version 4.0 BPB and the Windows NT BPB. |
||||||||||
0x27 | 4 |
Volume serial number Same as the field at 0x27 in the MS/PC-DOS version 4.0 BPB |
||||||||||
0x2B | 11 |
Volume label Same as the field at 0x2B in the MS/PC-DOS version 4.0 BPB |
||||||||||
0x36 | 8 |
Filesystem type Same as the field at 0x36 in the MS/PC-DOS version 4.0 BPB |
||||||||||
0x3E | 2 |
filesystem version number This is the functional version number — i.e. the lowest version of the filesystem driver that can understand the filesystem format. |
||||||||||
0x40 | 8 |
superblock number If this field has the value 0 the filesystem does not have a superblock. For the FAT filesystem format, the superblock is the "filesystem info sector". FAT imposes an additional requirement that the superblock must be in the volume's boot area. For other filesystem formats, such as HPFS and EXT2, this would provide a simple extension to enable the superblock to be located at an arbitrary location within the volume. The vanilla flavours of those filesystem formats impose the limitation that the superblock is at a single fixed position. Note two important differences from Microsoft's design: This is a 64-bit field, not a 16-bit one. The value 65535 is not given a special meaning. |
||||||||||
0x48 | 4 |
sectors per FAT This is the same as the sectors per FAT field in an MS/PC-DOS version 2.0 BPB, except that it is a 32-bit wide field. When writing a BPB: If the number of sectors per FAT is small enough to be stored as a 32-bit number, write it in this field. Otherwise write 0 in this field. When reading a BPB: If the field at offset 0x16 contains a non-zero value, that field is definitive and this field is ignored. Otherwise, this field is definitive if it contains a non-zero value, or if there is no other, wider, field. For other filesystem formats, there are no analogues to the file allocation tables and this field should be set to 0 when creating a BPB and ignored when reading one. |
||||||||||
0x4C | 4 |
root directory start cluster This field only has meaning if the volume is formatted with the FAT filesystem format. The start of the root directory never changes in normal operation on FAT formatted volumes (although FAT defragmentation utilities may change it). For volumes formatted from scratch, the root directory will always start in the same, default, location. Volumes converted from other filesystem formats may have the root directory in another location (wherever there happened to be free space in the other filesystem format), however. For other filesystem formats, the root directory is not a primary filesystem structure (a superblock or a master file table is) and this field should be set to 0 when creating a BPB and ignored when reading one. |
||||||||||
0x50 | 2 |
FAT flags These flags are used by the conversion process from 12-bit FAT or 16-bit FAT to 32-bit FAT. During the conversion process, the volume is formatted so that it holds both the original 12-bit/16-bit file allocation tables and the new 32-bit file allocation table. Because the first file allocation table starts in the same place (immediately after the boot area) irrespective of FAT width, this would be impossible in the absence of some mechanism to prevent the use of the first file allocation table by 32-bit FAT. These flags form that mechanism. During conversion, mirroring is disabled, and the active FAT number is set to the second file allocation table. After conversion, mirroring is then enabled. For other filesystem formats, there are no analogues to the file allocation tables and this field should be set to 0 when creating a BPB and ignored when reading one. |
||||||||||
0x52 | 8 |
reserved for future use Set to 0 when creating a BPB. Ignored when reading one. |