O'Reilly logo

FreeBSD Device Drivers by Joseph Kong

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required