ch01 5
ch01 5
Device control
Almost every system operation eventually maps to a physical device. With the
exception of the processor, memory, and a very few other entities, any and all
device control operations are performed by code that is specific to the device
being addressed. That code is called a device driver. The kernel must have
embedded in it a device driver for every peripheral present on a system, from the
hard drive to the keyboard and the tape drive. This aspect of the kernel’s func-
tions is our primary interest in this book.
Networking
Networking must be managed by the operating system, because most network
operations are not specific to a process: incoming packets are asynchronous
events. The packets must be collected, identified, and dispatched before a pro-
cess takes care of them. The system is in charge of delivering data packets across
program and network interfaces, and it must control the execution of programs
according to their network activity. Additionally, all the routing and address res-
olution issues are implemented within the kernel.
Loadable Modules
One of the good features of Linux is the ability to extend at runtime the set of fea-
tures offered by the kernel. This means that you can add functionality to the kernel
(and remove functionality as well) while the system is up and running.
Each piece of code that can be added to the kernel at runtime is called a module. The
Linux kernel offers support for quite a few different types (or classes) of modules,
including, but not limited to, device drivers. Each module is made up of object code
(not linked into a complete executable) that can be dynamically linked to the run-
ning kernel by the insmod program and can be unlinked by the rmmod program.
Figure 1-1 identifies different classes of modules in charge of specific tasks—a mod-
ule is said to belong to a specific class according to the functionality it offers. The
placement of modules in Figure 1-1 covers the most important classes, but is far from
complete because more and more functionality in Linux is being modularized.