## Storage Device Driver Reference

[prev][next][parent][TOC]

### BIOS Parameter Block (BPB) Management

The BPB resides at byte 0 in the first sector of a file system partition. This sector is called the operating system startup record. On non- partitioned media, the BPB resides at sector 0, byte 0.

The operating system startup record does not contain a partition table. The partition containing the operating system startup record is pointed to by an entry at the partition table contained in a master or extended boot record.

The BPB is is a shared data structure between a block device driver and the FAT file system. In the case of an HPFS, the driver maintains a pseudo BPB.

When the VolCB for the logical drive is created during OS2DASD initialization, the BPB for each logical drive is read.

Validation checks are made by OS2DASD on the BPB to determine if any BPB had been written to the media. In the absence of a valid BPB, OS2DASD creates one, based on the size of the partition. The remainder of the BPB fields are filled in by a table-driven lookup, based on the size of the volume. This BPB is supplied to the OS/2 Kernel and not written to the media.

The driver keeps two copies of the BPB. One representing the BPB determined from the media currently in the drive and one representing the device, assuming its maximum capacity.

For non-removable devices, the BPBs are always identical. For removable devices, the BPBs may differ if the media in the drive is formatted to a lower capacity than the drive is capable of handling.

An example would be a 720KB diskette in a 1.44MB diskette drive. The media BPB is altered to match the media when OS2DASD receives a Build BPB request packet. The device BPB is only altered by using the Category 08h, Function 43 "Set Device Parameters" IOCtl.

This would typically be done by FORMAT which forces a diskette drive to format media at a lower capacity than which it normally operates.

One other idiosyncrasy of BPBs is the Hidden Sector field. This is discussed further in the Request Packet Management section.