Chapter 13. Storage Drivers

image with no caption

In FreeBSD, storage drivers provide access to devices that transfer randomly accessible data in blocks (such as disk drives, flash memory, and so on). A block is a fixed-size chunk of data (Corbet et al., 2005). In this chapter I’ll discuss how to manage devices that employ block-centric I/O. To that end, some familiarity with disk and bio structures is needed, so that is where we’ll start.

disk Structures

A disk structure is the kernel’s representation of an individual disk-like storage device. It is defined in the <geom/geom_disk.h> header as follows:

struct disk { /* GEOM Private Data */ struct g_geom *d_geom; struct ...

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.