Devices are accessed either through calls to user-level functions (see Section 3U) or through calls to a standard device-independent interface (described here). User-level functions control common device operations. The standard interface, on the other hand, allows all aspects of a device that are controllable to be accessible to the user. Therefore, device operations that are not implemented in section 3U may be controlled through the standard interface.
The standard interface to the device drivers consists of the following calls: dopen, dclose, dread, dwrite, and diotctl. Using this scheme, the user calls the subroutine dopen with the name of the device to be controlled and is returned a file descriptor to be used in all subsequent references to the device. Reading and writing is done through the routines dread and dwrite while all other control passes through the dioctl subroutine. Finally, the device is closed by calling dclose.