The Device Header

The device header (Figure 14-2) lies at the beginning of the driver. It contains a link to the next driver in the chain, a set of attribute flags for the device (Figure 14-3), offsets to the executable strategy and interrupt routines for the device, and the logical-device name (if it is a character device such as PRN or COM1) or the number of logical units (if it is a block device).

Byte offset

Figure 14-2. Device-driver header. The offsets to the strat and intr routines are offsets from the same segment used to point to the device header.

Please refer to the printed book for this figure.

Bit Significance

15 1 if character device, 0 if block device

14 1 if IOCTL read and write supported

13 for block devices:

1 if BIOS parameter block in boot sector should be used to

determine media characteristics, 0 if media ID byte should

be used

for character devices:

1 if output until busy supported

12 Reserved (should be 0)

11 1 if open/close/removable media supported (MS-DOS 3.0 and

later)

7—10 Reserved (should be 0)

6 1 if generic IOCTL and get/set logical drive supported

(MS-DOS 3.2 and later)

5 Reserved (should be 0)

4 1 if CON driver and Int 29H fast-output function supported

3 1 if current CLOCK$ device

2 1 if current NUL device

1 for block devices:

1 if driver supports 32-bit sector addressing (MS-DOS 4.0)

for character devices:

1 if standard output device (stdout)

0 1 if current standard input device (stdin)

Figure 14-3. Device attribute word in device header. In block-device drivers, only bits 6, 11, and 13—15 (and bit 1 in MS-DOS version 4.0) have significance; the remainder should always be zero.