Linux Kernel Architecture

(Jacob Rumans) #1

Chapter 6: Device Drivers


Chapter 6: Device Drivers....................................................


device type and model. Secondly, the kernel must provide user applications and system tools with
ways of accessing the various devices. Wherever possible, a uniform scheme should be adopted
to keep programming effort within limits and to ensure that applications are able to interoperate
regardless of the particular hardware approach. Thirdly, userspace needs to know which devices
are available in the kernel.

Communication with peripherals is layered as illustrated in Figure 6-1.

User

Kern

VFS
Driver
Hardware

Application

/dev/xyz

Device special file

open, read,
write etc.

Figure 6-1: Layer model for addressing
peripherals.

Access to each individual device is performed via abstraction layers arranged hierarchically. At the
bottom of the hierarchy is the device itself, which is attached to other devices and the system CPU by
means of a bus system. Communication with the kernel follows this path.

Before we examine the relevant algorithms and structures in the Linux kernel, it is worthwhile taking a
brief look at how expansion hardware generally works.For detailed descriptions, readers are referred to
hardware-specific publications such as [MD03].

6.1.1 Expansion Hardware


Hardware devices may be attached to the system in various ways; internal slots on the motherboard or
external connectors are the most common methods. Of course, expansions can also be accommodated
directly on the system board; this method has gained in popularity over the last few years. Whereas in
the 80386 era it was quite usual to house the hard disk controller as an expansion board in a special slot
on the motherboard, server boards are now commonplace; they are able to accommodate networks, USB,
SCSI, graphic cards, and the like without the need for bulky plug-in cards. This trend toward miniatur-
ization is being pushed even further in handhelds and mini-laptops. As far as the kernel is concerned, it
generally makes no differencehowa peripheral is attached to the rest of the system because these details
are abstracted from the hardware.

Bus Systems


Even though the spectrum of peripherals — ranging from CD writers, modems, and ISDN boards to
cameras and sound cards — may appear to be unlimited, they all share one thing in common. They are
Free download pdf