Chapter 8. Devices

8.1 Device Overview

This chapter describes the part of the system that interfaces with the hardware as is shown in the bottom part of Figure 7.1. Historically, the device interface was static and simple. Devices were discovered as the system was booted and did not change thereafter. Filesystems were built in a partition of a single disk. When a disk driver received a request from a filesystem to write a block, it would add the base offset of the partition and perform a bounds check based on information from its disk label. It would then do the requested I/O and return the result or error to the filesystem. A typical disk driver could be written in a few hundred lines of code.

As the system has evolved, the complexity of the ...

Get Design and Implementation of the FreeBSD Operating System, 2nd Edition 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.