O'Reilly logo

Professional Linux Kernel Architecture by Wolfgang Mauerer

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

Modules are an efficient way of adding device drivers, filesystems and other components dynamically into the Linux kernel without having to build a new kernel or reboot the system. They remove many of the restrictions constantly raised as arguments against monolithic architectures by, above all, micro-kernel proponents. These arguments concern primarily the lack of dynamic extensibility. In this chapter, we examine how the kernel interacts with the modules; in other words, how they are loaded and unloaded and how the kernel detects the interdependencies between various modules. It is therefore necessary to deal in some detail with the structure of module binaryfiles (and their ELF structure).

Overview

Modules have many advantages,[140] of which the following are worthy of particular mention:

  • By using modules, distributors are able to pre-compile a comprehensive collection of drivers without bloating the size of the kernel image beyond bounds. After automatic hardware detection or user prompting, the installation routine selects the appropriate modules and adds them into the kernel.

    This enables even inexperienced users to install drivers for system devices without having to build a new kernel. This represents a major step toward (and perhaps even a prerequisite for) wider acceptance of Linux systems.

  • Kernel developers can pack experimental code into modules that can be unloaded and reloaded after each modification. This allows new features to be tested quickly without ...

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