|
| |
CREATING A DEVICE DRIVER
To create a device driver that DOS can install, perform the
following:
1) Create a memory image file or an EXE file with a device
header at the start of the file.
2) Originate the code (including the device header) at 0, not
100h.
3) Set the next device header field. Refer to "Pointer to Next
Device Header Attribute Field" for more information.
4) Set the attribute field of the device header. Refer to
"Attribute Field" for more information.
5) Set the entry points for the interrupt and strategy
routines.
6) Fill in the name/unit field with the name of the character
device or the unit number of the block device.
DOS always processes installable character device drivers before
handling the default devices. So to install a new CON device,
simply name the device CON. Be sure to set the standard input
device and standard output device bits in the attribute field of
a new CON device. The scan of the device list stops on the first
match so the installable device driver takes precedence.
NOTE: Because DOS can install the device driver anywhere in
memory, care must be taken in any FAR memory references.
You should not expect that your driver will be loaded in
the same place every time. |