Chapter
5
I
Device Drivers
BUILD BPB (BIOS Parameter Block)
Command code
=
2
ES:BX
13-BYTE Request Header
BYTE Media descriptor from DPB
DWORD transfer address
(Points to one sector worth
of
scratch space
or
first sector
of
FAT depending on the value
of
the
NON
IBM FORMAT bit)
DWORD pointer
to
BPB
If
the
NON
IBM FORMAT bit
of
the device is set, then the
DWORD transfer address points to
a
one-sector buffer, which can
be used for any purpose. If the
NON
IBM FORMAT bit is
0,
then this buffer contains the first sector of the first FAT and the
driver must not alter this buffer.
If IBM compatible format is used
(NON
IBM FORMAT BIT
=
0),
the
first
sector of the
first
FAT must be located at the same
sector on all possible media. This is because the FAT sector will
be read before the media is actually determined. Use this mode
if all you want is
to
read the FAT ID byte.
In addition
to
setting status word, the driver must set the
pointer to the BPB
on
return.
The information relating
to
the BPB
for
a particular piece
of
me-
dia is kept in the boot sector for the media. The following chart
illustrates the format
of
the boot sector:
183