The tty.h file is used for character mode drivers, while buf.h is used by all block mode devices. Device registers are defined in the device driver header and are based on the device. Toggle commands for the device are defined as their device codes. The routine disables interrupts from the device and issues any shut-down commands. All internal references to the device will be reset.
Exceptions are removable media and exclusive-use devices.
The buffer header contains the instructions for a read or write along with a memory location for the operation to occur to or from. The size of the buffer is usually fixed at installation and varies from 512 to 1024 bytes. A device's block size may be smaller than the buffer block size, in which case, the driver executes multiple reads or writes. The strategy function can be illustrated in a sample device driver for a hard disk. The operation is analogous to that of the write procedure.