An installable character-device driver handles input and output for a device such as a keyboard, screen, or serial port. A character-device driver must implement the following device-driver functions:
Function | Name | Comments |
00h | Init | ||
03h | IOCTL Read | “Required only if bit 14 is set in the dhAttributes field of the DEVICEHEADER structure” | |
04h | Read | ||
05h | Nondestructive Read | ||
06h | Input Status | ||
07h | Input Flush | ||
08h | Write | ||
09h | Write with Verify | ||
0Ah | Output Status | ||
0Bh | Output Flush | ||
0Ch | IOCTL Write | Required only if bit 14 in dhAttributes is set | |
0Dh | Open Device | Required only if bit 11 in dhAttributes is set | |
0Eh | Close Device | Required only if bit 11 in dhAttributes is set | |
10h | Output Until Busy | Required only if bit 13 in dhAttributes is set | |
13h | Generic IOCTL | Required only if bit 6 in dhAttributes is set | |
19h | IOCTL Query | Required only if bit 7 in dhAttributes is set |
Every character-device driver must have a logical-device name that identifies the driver and is used by programs to open the device. Logical-device names need not be unique, but using the same name in two or more drivers prevents MS-DOS from accessing all but the last driver to be initialized. This is because MS-DOS, when opening a device, searches the driver chain from the beginning until it finds a driver that has a matching logical-device name. Since the last driver initialized is always closest to the beginning, MS-DOS stops its search there. Note that resident device drivers can be replaced by giving an installable driver the same logical-device name as the resident driver.