How version 7.0 BIOS Parameter Blocks should have been designed

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.

The BPB structure from MS-DOS version 7.0
offset from start of boot blockwidth in octetsdescription
0x0B25

MS/PC-DOS version 3.4 BPB

0x241

Disc unit number

Same as the field at 0x24 in the MS/PC-DOS version 4.0 BPB

0x251

"chkdsk" flags

Same as the field at 0x25 in the MS/PC-DOS version 4.0 BPB

0x261

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.

0x274

Volume serial number

Same as the field at 0x27 in the MS/PC-DOS version 4.0 BPB

0x2B11

Volume label

Same as the field at 0x2B in the MS/PC-DOS version 4.0 BPB

0x368

Filesystem type

Same as the field at 0x36 in the MS/PC-DOS version 4.0 BPB

0x3E2

filesystem version number

This is the functional version number — i.e. the lowest version of the filesystem driver that can understand the filesystem format.

0x408

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.

0x484

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.

0x4C4

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.

0x502
Meaning of the FAT flags
bit(s)description
15–8Reserved for future use. Always initialize to 0, preserve current value thereafter.
7–4Active FAT number (if mirroring is disabled)
3–1Reserved for future use. Always initialize to 0, preserve current value thereafter.
0FAT mirroring: 0 = enabled 1 = disabled

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.

0x528

reserved for future use

Set to 0 when creating a BPB. Ignored when reading one.


© Copyright 2006–2006 Jonathan de Boyne Pollard. "Moral" rights asserted.
Permission is hereby granted to copy and to distribute this web page in its original, unmodified form as long as its last modification datestamp is preserved.