Chapter 3. Device Communication and Control

image with no caption

In Chapter 1 we constructed a driver that could read from and write to a device. In addition to reading and writing, most drivers need to perform other I/O operations, such as reporting error information, ejecting removable media, or activating self-destruct sequences. This chapter details how to make drivers do those things.

We’ll start by describing the ioctl interface, also known as the input/output control interface. This interface is commonly used for device communication and control. Then we’ll describe the sysctl interface, also known as the system control interface. This interface is used to dynamically ...

Get FreeBSD Device Drivers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.