world leader in high performance signal processing
Trace: » modules

Linux Kernel Modules

Modules are pieces of kernel code that can be loaded or removed with a running kernel after it has booted.

They are often used to load device drivers or other kernel components that are needed by the kernel as it responds to user or hardware actions.

For example, plugging in a USB device will trigger an action by the kernel to load all the components it needs to access the device.

Overview

Dynamic loading and symbol look-up techniques allow this process to alter kernel operation significantly during the init_module call.

The additional resources that were introduced into the kernel during module load are to be removed when the module is unloaded. Any module resources still in use at the unload time have to be managed.

The following picture serves as an overview to the module process.

As extensions of the kernel, modules execute at a high privilege level and have access to all kernel memory and services.

  • A module can execute privileged instructions such as I/O.
  • A module can call any global kernel function.
  • A module can access any kernel memory location
  • A failure in a module can easily bring down the entire system.
  • A module that fails to install cannot be removed.
  • There's no protection against anything with Kernel privileges.

Further Info

This documentation covers the following areas:

For further reading, check out chapter two of Linux Device Drivers (3rd Edition) by Jonathan Corbet and Alessandro Rubini.