Fitting into the OS: The Device Driver

This lesson discusses device drivers, abstraction to fit different devices with specific interfaces into the OS.

We'll cover the following

One final problem we will discuss: how to fit devices, each of which has very specific interfaces, into the OS, which we would like to keep as general as possible. For example, consider a file system. We’d like to build a file system that worked on top of SCSI disks, IDE disks, USB keychain drives, and so forth, and we’d like the file system to be relatively oblivious to all of the details of how to issue a read or write request to these different types of drives. Thus, our problem:

THE CRUX: HOW TO BUILD A DEVICE-NEUTRAL OS

How can we keep most of the OS device-neutral, thus hiding the details of device interactions from major OS subsystems?

Device driver

The problem is solved through the age-old technique of abstraction. At the lowest level, a piece of software in the OS must know in detail how a device works. We call this piece of software a device driver, and any specifics of device interaction are encapsulated within.

Let us see how this abstraction might help OS design and implementation by examining the Linux file system software stack. The figure presented below is a rough and approximate depiction of the Linux software organization.

Get hands-on with 1200+ tech skills courses.