Chapter 7. Devices

7.1 Device Overview

This chapter describes the part of the system that interfaces to the hardware as is shown in the bottom part of Figure 6.1 (on page 216). 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 do 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, ...

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