world leader in high performance signal processing
Trace: » module-init-tools

New Kernel Module Loader

The 2.6 Kernel requires a new Kernel Module Loader.

With the 2.6 kernel a lot of the module loading functionality has been moved into the kernel. Most of the module install work is done by a new system call init_module.

The following user code example shows how the insmod and modprobe utilities use the new call.

       ret = init_module(file, len, options);
                         file = module name
                         len  = module size
                         options = load options

A configuration file /etc/modprobe.conf file can be created from an older /etc/modules.conf file using a new script called generate-modprobe.conf.

Module Loading

The kmod kernel task is responsible to auto loading kernel modules. It actually uses a user mode task called /sbin/modprobe. This uses information from a number of files to get the module loaded and configured.

  • /etc/modprobe.conf - overrides or modifies default actions for loading modules
  • /lib/modules/2..x-<sub version name>/modules.dep - a file that lists all the modules found and declares other modules that need to be loaded prior to loading a specified module.

The modules.dep file can be produced automatically by a program called depmod, which is run as a normal part of the uClinux-dist build process (you should not need to do this by hand).

Modules can also be loaded manually using the modprobe or insmod commands. modprobe can only be used when the module is described in the /lib/modules/2..x-<sub version name>/modules.dep file, if it is not in there, use insmod

If you want to see all the modules loaded in a running kernel use the lsmod command.

Note that you have to be superuser or root to insert or remove modules.

root: /> lsmod
Module                  Size  Used by
nls_utf8                2176  1
ext3                  115688  3
jbd                    61348  1 ext3
vfat                   13056  0
fat                    43168  1 vfat
sbp2                   22792  3
snd_seq                53008  1
bluetooth              44932  0
nvram                   8328  0
usbserial              26856  0
parport_pc             37824  1
lp                     10536  0
parport                37960  2 parport_pc,lp
nfsd                  106824  5
exportfs                5632  1 nfsd
speedstep_lib           4228  0
freq_table              4356  0
processor              25640  0
[...]  and many more

More Information

The Device Drivers section goes into more detail on modules.

See also the following man pages

  • insmod
  • modprobe
  • depmod
  • modprobe.conf