Glossary · Automation software engineering and architecture
Kernel module
Also known as: Loadable kernel module (LKM)
German: Kernelmodul
In operating systems, a kernel module is a piece of code that can be loaded into and unloaded from the running operating system kernel to extend its functionality, typically to add device drivers, file systems or network protocols, and that runs with full kernel privileges.
- Software engineering
In one sentence
A kernel module is code loaded into a running operating system kernel to extend it, for example with a device driver, with full privileges.
Example
The industrial PC loads a kernel module for its fieldbus card at boot, which makes the card available to the soft PLC runtime.
How it applies
- Engineering: Kernel modules are the usual way to provide drivers on Linux-based controllers and industrial PCs. A defect in a module can crash or compromise the whole system, because it runs without the protection user-space code has.
- Maintenance: Kernel modules often have to be rebuilt for each kernel version, because the internal kernel interface is not stable. Kernel updates therefore require matching module versions.
- Security: Only trusted modules should be loadable; module signing and restricted loading reduce the risk of malicious code in the kernel.
- Documentation: Document required modules, supported kernel versions and how to check that modules are loaded. Update instructions must include module updates wherever the kernel changes.
Kernel module vs. user-space driver
A kernel module runs inside the kernel with full privileges; a user-space driver runs as a normal process and accesses hardware through defined kernel interfaces. User-space drivers are safer to develop and update but may add latency.