Specifications

D
evice Driver Programming
13-2
The DLM Mechanism 13
Loadable Module Types 13
Since this book is about device drivers, this chapter focuses on loadable device drivers.
However, you should be aware that the DLM feature supports loading and unloading of a
variety of kernel module types.
Types of modules that can be loaded include
device drivers (block, character, STREAMS and pseudo)
high-level drivers (HDRV)
STREAMS modules
file systems
exec modules
miscellaneous modules—for example, modules containing code for sup-
port routines shared among multiple loadable modules which are not
required in the statically configured kernel
Although the discussion focuses on device drivers, the information being presented in this
chapter applies—in a general way—to all loadable module types.
The Difference between Static Modules and Loadable Modules 13
With DLM, some modules continue to be linked to the kernel in the traditional manner.
Kernel modules that are configured this way are called static modules. A static module is,
by definition, non-loadable. That is, the module remains linked into the kernel at all times
because either it is always required in the system (like the boot hard disk driver), or it is
used so frequently or consumes so few resources (like the user terminal pseudo-device
driver) that it makes sense to keep the module continuously configured.
Other modules—modules that are not always required, are used infrequently, or consume
large amounts of resources—can be configured so they can be included or excluded from
the kernel dynamically, without a system shutdown and reboot. These modules are called
loadable modules.
Loadable modules are also maintained as individual object files, but they are not statically
linked to the kernel. Instead, they are linked into the kernel when they are needed and
unlinked when they are no longer in-use. Floppy disk drivers and RAM disk drivers are
two examples of kernel modules that are typically configured as loadable modules.