Kernel module

from Wikipedia, the free encyclopedia

As a kernel module kernel extension module, or kernel extension ( English kernel module, kernel extension module, kernel extension ) is a complementary software called unit that a running kernel (operating system) during runtime can load and without rebooting. Kernel modules extend the capabilities of the kernel, for example by adding drivers , file systems , system calls and other interfaces that the kernel does not initially include.

Charging can take place when the system is initialized or only when there is an actual need - when connecting a device or when certain functions are called - and discharging again as soon as it is no longer needed. This is called dynamic loading ( english dynamic load ) refers.

Use

The ability to expand the kernel capabilities reduces the need to adapt and recompile the kernel and also reduces the number of restarts that would otherwise be necessary .

Modern operating systems should generally work on and with different computer and peripheral devices and accordingly provide drivers for different components of computers, expansion cards and peripheral devices . Kernel modules make it possible that only the drivers required for the actually available hardware are loaded into the main memory and that their functions do not have to be statically supplied in the kernel. The implementation as a loadable expansion module also makes it possible that additional functional expansions from third-party providers can be used, e.g. B. as a device driver for their hardware or another file system that is provided by independent developers.

Through plug and play the appropriate kernel modules are normally requested automatically by the kernel when the appropriate hardware is found. For this purpose, the module registers all devices for which it is responsible in a list managed by the kernel , so that the kernel can find and load it when it is needed. In the case of very old devices (e.g. ISA expansion cards) or if this is not possible automatically for other reasons, an expansion module can also be activated again via the start configuration or by means of recognition programs (e.g. the hardware or a required file system) loaded automatically, or loading is initiated by the user himself. As a kernel module, a driver can also be updated during operation by first unloading it and then reloading its newer version.

Kernel modules in Linux distributions

Although Linux is a monolithic kernel , it also includes an interface in order to be able to add loadable kernel modules ( English loadable kernel modules , LKM for short ). Kernel modules are files that contain object code (object files). They are usually /usr/lib/modules/$(uname -r)/stored under and have the filename extension .ko( English kernel object ; until kernel version 2.4 was.Othe filename extension). Loaded kernel modules may a. lsmodcan be listed with the command .

Kernel modules at FreeBSD

With FreeBSD 3.0, a so-called dynamic kernel linker facility was introduced ( kld for short ; something like ' dynamic kernel linker facility '), which replaced the previous LKM facility . Extensions are here in the directory /boot/kernel/. The most important commands in this regard are kldload(8), kldunload(8)and kldstat(8).

Kernel extensions for macOS, iOS & Co.

A kernel extension ( English kernel extensions ) for XNU , the kernel of Darwin , the base of macOS and iOS and Apple's other operating system is loaded on demand. They are in the directory /System/Library/Extensions/and have.kextas a filename extension .

For security reasons, this option has been discarded for third-party providers and completely replaced. While a kernel extension in kernel mode is running, the run with macOS Catalina 15/10 introduced system extensions ( English system extensions ) in user mode and have so for example, no direct access to hardware.

Individual evidence

  1. a b kernel modules. In: Wiki from ubuntuusers.de. Retrieved March 6, 2020 .
  2. a b kernel modules. In: Wiki from archlinux.de. Retrieved March 6, 2020 .
  3. Alessandro Rubini, Jonathan Corbet: Create and start modules. Chapter 2. In: Linux Device Drivers, 2nd Edition, April 2002. O'Reilly, accessed March 6, 2020 .
  4. ^ A b Bryan Henderson: Linux Loadable Kernel Module HOWTO. September 24, 2006, accessed March 6, 2020 .
  5. Deprecated Kernel Extensions and System Extension Alternatives. Apple, archived from the original on February 26, 2020 .;
  6. System Extensions and DriverKit. Apple, archived from the original on October 14, 2019 .;
  7. Leo Becker: Kernel Extensions in macOS: Apple heralds the end. In: Heise online . February 10, 2020 . Retrieved March 4, 2020 .; Quote: "The new" System Extensions "should gradually replace classic kernel extensions. You can no longer intervene so deeply in the system: Instead of running in the kernel space, the system extensions run in the user space. "