Installation guide

Chapter 24.
Kernel Modules
The Linux kernel has a modular design. At boot time, only a minimal resident kernel is
loaded into memory. Thereafter, whenever a user requests a feature that is not present in
the resident kernel, a kernel module is dynamically loaded into memory. After a specified
period of inactivity, the module may be removed from memory.
The mechanism that supports dynamic loading of modules is a kernel thread called kmod.
Modules are not loaded unless they are needed. When the kernel requests a module, the
module is loaded along with all its module dependencies.
Red Hat Linux also includes a cron task that removes all unused modules every ten min-
utes. The cron task is located in the file /etc/cron.d/kmod. Refer to Section 22.1 for more
information on cron tasks.
When you install Red Hat Linux, the hardware on your system is probed and you provide
information about how the system will be typically used and which programs should be
loaded. Based on this probing and the information you provide, the installation program
decides which modules need to be loaded at boot time. The installation program sets up the
dynamic loading mechanism to work transparently. If you build your own custom kernel,
you can make all of these decisions for yourself.
If you add new hardware after installation and the hardware requires a kernel module, you
need to set up the dynamic loading mechanism. Kudzu usually detects new hardware. You
can also add the new driver by editing the module configuration file, /etc/modules.conf.
For example, if your system included a model SMC EtherPower 10 PCI network adapter at
the time of installation, the module configuration file will contain the following line:
alias eth0 tulip
After installation, if you install a second identical network adapter to your system, add the
following line to /etc/modules.conf:
alias eth1 tulip
See the Official Red Hat Linux Reference Guide for an alphabetical list of kernel modules and
the hardware supported by the modules.
24.1. Kernel Module Utilities
You can also use a group of commands to list, load, or unload kernel modules. These com-
mands are useful if you want to try different modules or see if a module has been loaded
successfully.
The command /sbin/lsmod displays a list of currently loaded modules.
Example 24-1. Example lsmod output
Module Size Used by
sr_mod 15264 0 (autoclean)
mga 95984 1
agpgart 23392 3
nfs 79008 1 (autoclean)
lockd 52464 1 (autoclean) [nfs]