A kernel module is an Object File that can be dynamically loaded in and out of the Kernel without rebooting.

  • Kernel modules allow Monolithic Kernels (like Linux) to dynamically add kernel functionality, e.g. a keyboard is plugged in, without recompiling the entire kernel
  • All Drivers are Kernel Modules, but not all Kernel Modules are Drivers
  • Find them in /lib/modules/$(uname -r)/kernel/. They end in the .ko (Kernel Object) extension.

Commands

CommandActionDescription
lsmodListShows all currently loaded modules and their sizes.
modinfo <name>InfoDisplays metadata (author, license, description, parameters).
sudo modprobe <name>LoadIntelligently loads a module and all its dependencies.
sudo modprobe -r <name>RemoveSafely unloads a module and its unused dependencies.
insmod / rmmodRawOlder, “dumb” tools that load/unload a single .ko file without checking dependencies.