|
|
To be able to link a driver into the kernel, you must create a number of files that define the structure and capabilities of the driver for the link. These files constitute the components of a Driver Software Package (DSP):
An example Master file entry might look like this:
xnamex Iocrwi iHc xx 0 0 1 1 1The first field (``xnamex'') is the internal name of the driver consisting of up to 8 characters. The second field (``Iocrwi'') indicates that the driver has init, open, close, read, write, and ioctl routines. The third field (``iHc'') specifies that the driver is installable, controls actual hardware, and is a character driver. The fourth field (``xx'') is the prefix of the driver routines. The prefix can be up to 5 characters long and, although it does not have to be the same as the device name field, it helps minimize confusion if they are the same. The fifth and sixth fields (block and character major device numbers) are 0 and will be filled in automatically. The seventh and eighth fields are the minimum and maximum numbers of device units. The ninth field indicates the DMA channel that will be used.
An example System file entry might look like this:
xnamex Y 1 5 1 1 338 341 0 0The first field (``xnamex'') must be the same as the first field in the Master file. The second field (``Y'') indicates that the driver is to be linked into the kernel. The third field usually indicates the number of units connected to the controller. The fourth field (``5'') is the interrupt priority level (IPL); the CPU software priority level at which interrupts will be processed. The ``1'' in the fifth field indicates that the driver needs exclusive use of the interrupt request line (IRQ) specified in the sixth field. In this example, the controller uses interrupt 1. The seventh and eighth fields are the start and end I/O addresses. In this example, the device does not respond to dual-ported RAM addresses, so the ninth and tenth fields are set to ``0''.