Specifications

D
evice Driver Programming
17-10
Generally a user-level device driver performs I/O asynchronously rather than
synchronously. The reason is that asynchronous I/O operations require the least amount of
overhead. Blocking for synchronous I/O operations requires a process to enter the kernel;
entering the kernel defeats the purpose of providing a user-level device driver. A user-level
driver usually provides routines for initiating an asynchronous I/O request and checking
the status of an asynchronous I/O operation.
The names of a user-level device driver’s routines have a common format:
xx_name
The prefix xx represents a character string identifying the device that the driver controls.
This prefix should uniquely identify the device. For user-level device drivers written by
Concurrent Computer Corporation personnel, the prefix should be the device name as
documented in Section 7 of the system manual pages. The name identifies the type of rou-
tine (for example, open, close, aread, awrite, or other routine specific to the
device).
Example names from the user-level device driver for the DR11W emulator are as follows:
dr11w_open
dr11w_close
dr11w_aread
dr11w_set_modes
dr11w_get_modes
dr11w_intr
The types of routines that a user-level driver might include are briefly described as
follows:
xx_open open the device in preparation for I/O
xx_close close the device
xx_aread perform an asynchronous read of data from the device
xx_awrite perform an asynchronous write of data to the device
xx_acheck obtain the completion status of an asynchronous I/O operation
xx_await wait for completion of an asynchronous I/O operation
xx_control perform a particular device control operation
xx_intr process an interrupt generated by the device
A standard interface has been defined for the open, close, aread, awrite, acheck,
await, and control routines. This interface is described in detail in “Developing the
Driver’s I/O Service Routines” on page 17-23. The user-level driver interrupt service
routine is described in “Developing the Driver’s Interrupt Service Routine” on page
17-34.