Linux Loadable kernel modules in Linux are loaded (and unloaded) by the
modprobe command. They are located in /lib/modules or /usr/lib/modules and have had the extension .ko ("kernel object") since version 2.6 (previous versions used the .o extension). The
lsmod command lists the loaded kernel modules. In emergency cases, when the system fails to boot due to e.g. broken modules, specific modules can be enabled or disabled by modifying the kernel boot parameters list (for example, if using
GRUB, by pressing 'e' in the GRUB start menu, then editing the kernel parameter line).
License issues In the opinion of Linux maintainers, LKM are
derived works of the kernel. The Linux maintainers tolerate the distribution of
proprietary modules (such as
NVIDIA GPU drivers), but allow only
GNU General Public License (GPL) modules to merge to kernel tree of mainline Linux kernel. Loading a proprietary or non-GPL-compatible module will set a 'taint' flag in the running kernel—meaning that any problems or bugs experienced will be less likely to be investigated by the maintainers. LKMs effectively become part of the running kernel, so can corrupt kernel data structures and produce bugs that may not be able to be investigated if the module is indeed proprietary.
Linuxant controversy In 2004, Linuxant, a consulting company that releases proprietary
device drivers as loadable kernel modules, attempted to abuse a
null terminator in their MODULE_LICENSE, as visible in the following code excerpt: MODULE_LICENSE("GPL\0for files in the \"GPL\" directory; for others, only LICENSE file applies"); The string comparison code used by the kernel at the time tried to determine whether the module was GPLed stopped when it reached a null character (\0), so it was fooled into thinking that the module was declaring its license to be just "GPL".
FreeBSD Kernel modules for
FreeBSD are stored within /boot/kernel/ for modules distributed with the
operating system, or usually /boot/modules/ for modules installed from
FreeBSD ports or
FreeBSD packages, or for proprietary or otherwise binary-only modules. FreeBSD kernel modules usually have the extension .ko. Once the machine has booted, they may be loaded with the kldload command, unloaded with kldunload, and listed with kldstat. Modules can also be loaded from the loader before the kernel starts, either automatically (through /boot/loader.conf) or by hand.
macOS Some loadable kernel modules in macOS can be loaded automatically. Loadable kernel modules can also be loaded by the kextload command. They can be listed by the kextstat command. Loadable kernel modules are located in
bundles with the extension .kext. Modules supplied with the operating system are stored in the /System/Library/Extensions directory; modules supplied by third parties are in various other directories.
NetWare A NetWare kernel module is referred to as a
NetWare Loadable Module (NLM). NLMs are inserted into the NetWare kernel by means of the LOAD command, and removed by means of the UNLOAD command; the modules command lists currently loaded kernel modules. NLMs may reside in any valid search path assigned on the NetWare server, and they have .NLM as the file name extension.
VxWorks A downloadable kernel module (DKM) type project can be created to generate a ".out" file which can then be loaded to kernel space using "ld" command. This downloadable kernel module can be unloaded using "unld" command.
Solaris Solaris has a configurable kernel module load path, which defaults to /platform/platform-name/kernel /kernel /usr/kernel. Most kernel modules live in subdirectories under /kernel; those not considered necessary to boot the system to the point that init can start are often (but not always) found in /usr/kernel. When running a DEBUG kernel build the system actively attempts to unload modules. == Binary compatibility ==