BIOS Parameter Block

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DR

BIOS Parameter Block

Post by DR »

Hello, I made a perfectly good Master Boot Record and I'm now proceding to the 'partition boot record' (1st sector of partition). But I would need some more info about the BIOS Parameter Block. Is this always necessary? What fields does it contain? etc. I ran it through google a few types but found little or no useful info.

Thanx in advance, DR
Schol-R-LEA

RE:BIOS Parameter Block

Post by Schol-R-LEA »

Assuming you intend to make a FAT16 or FAT32 file system, yes (it's needed for FAT12, too, but you clearly aren't talking of a floppy disk if you are writing the MBR). Other filesystems have different types of headers, if any.

It could be noted that the BPB is that it was originally designed for 180K single-sided disks, and modified over time to support other types of media. This will explain certain of it's peculiarities, I think.

The BIOS Parameter Block is a data structure containing the information about the disk medium and sector structure necessary to find and read the FAT table and the beginning of the file data (more on this later).

The field names, sadly, are not standardized; Microsoft, who have changed the nomenclature more than once, currently list them as:

Field               Offset     Length
-----               ------     ------
OEM ID                03         8
Bytes Per Sector      11         2
Sectors Per Cluster   13         1
Reserved Sectors      14         2
FATs                  16         1
Root Entries          17         2
Small Sectors         19         2
Media Descriptor      21         1
Sectors Per FAT       22         2
Sectors Per Track     24         2
Heads                 26         2
Hidden Sectors        28         4
Large Sectors         32         4

In addition to these, there is the 'Extended BPB', which contains useful but less critical information about the disk:

Field                  Offset   Length
-----                  ------   ------
Physical Drive Number    36        1
Current Head             37        1
Signature                38        1
ID                       39        4
Volume Label             43       11
System ID                54        8

Source: http://support.microsoft.com/default.as ... US;Q140418&

Offsets are zero-based. Note that, officially, the OEM ID not considered part of the BPB; I added it to the list for clarity's sake.

The MS page linked above gives a brief review of the fields values; for more detailed discussion, and some general advice, you might want to check out an earlier post of mine (http://204.215.248.28/board.jsp?message=1003); the links are at the bottom.

HTH. C&CW.
DR

RE:BIOS Parameter Block

Post by DR »

Thanks a lot this info has been very helpful :)

DR
Post Reply