Search notes:

Linux kernel module

A (loadable) kernel module allows to extend the functionality of the kernel (new hardware, Filesystem, system calls) or modify the behavior of the kernel at runtime (without restarting the kernel) by inserting or removing special code into/from the kernel.
Modules that are listed in a /etc/modules-load.d/*.conf file are automatically loaded when the system starts up.

Parameters

When loaded into the kernel, a module shows its parameters in /sys/module/module-name/parameter/parameter-name.
The current list of all parameters of a loadable module can be shown with
modinfo -p $modulename
Some parameters can be changed at runtime like so:
echo -n $value > /sys/module/module-name/parameter/parameter-name

Module names

The Kernel has a single global namespace for all modules.
Hyphens (-) and underscores (_) are not differentiated in module names.

Relation to firmware

An answer in a Gentoo forum says that there are four possible combinations for a module that needs fimware:
A built in driver cannot load its firmware from /lib/firmware as root is not yet mouted.
A loadable module cannot get its firmware from inside the kernel as its no longer available.

Shell commands

insmod inserts a module into the kernel.
lsmod displays loaded modules.
modinfo show information about a module.
modprobe adds or removes modules to/from the kernel.
systool -v -m module_name shows the set options for a module.

See also

DKMS
/proc/modules, /sys/module
kernel/module.c

Index