Chapter 4: Writing Character Device Drivers
Unix-based systems expose hardware to user space by means of special files, all created in the /dev
directory upon device registration with the system. Programs willing to access a given device must locate its corresponding device file in /dev
and perform the appropriate system call on it, which will be redirected to the driver of the underlying device associated with that special file. Though system calls redirection is done by an operating system, what system calls are supported depends on the type of device and the driver implementation.
On the topic of types of devices, there are many of them from a hardware point of view, which are, however, grouped into two families of special device files in /dev
– these are block devices and character devices. They are differentiated by the way they are accessed, their speed, and the way data is transferred between them and the system. Typically, character devices are slow and transfer data...