Chapter
5
I
Device Drivers
INIT
Command code
=
0
ES:BX
1
13-BYTE Request Header
I
I
BYTE Number of units
I
DWORD Break address
DWORD Pointer to BPB
array
(Not set by character devices)
The number
of
units, break address, and BPB pointer are set by
the driver. On entry, the DWORD to be set to the BPB
array
(on
block devices) points
to
the character following
‘
=
’
on the line in
CONFIGSYS that loaded this device. This allows drivers
to
scan
CONFIGSYS invocation line
for
arguments.
If there are multiple device drivers in a single .COM file, the
ending address returned by the last INIT called will be used by
MS-DOS. It is recommended that all device drivsrs in
a
single
.COM file return the same ending address.
MEDIA
CHECK
CommandCode
=
1
ES:BX
1
13-BYTE Request Header
I
ITE Media descriptor from DPB
I
BYTE Returned
In addition
to
setting the status word, the driver must set the
return byte to one
of
the following:
-1
Media has been changed
0
Don’t know if media has been changed
1
Media has not been changed
If
the driver can return
-1
or
1
(by having a door-lock
or
other
interlock mechanism), MS-DOS performance is enhanced be-
cause MS-DOS does not need
to
re-read the FAT for each direc-
tory access.
182