Penguin
Annotated edit history of Module version 7, including all changes. View license author blame.
Rev Author # Line
1 JohnMcPherson 1 In computer software, a [Module] means an optional piece of code that isn't required for a program to run, but can be loaded when needed.
2
2 JohnMcPherson 3 When talking about the [Linux] [Kernel], it means a Driver or other piece of code that the kernel can load and use on request. Examples include [DeviceDriver]s for various pieces of hardware that aren't required for the computer to boot and work (such as sound card or graphics card drivers), and modules for various network protocols and disk formats that might not be used very often, so don't need to be loaded in memory all the time (such as the ISO-9660 disk format used by [CDROM]s, or the [PPP] or [IPv6] network protocols).
1 JohnMcPherson 4
5 JohnMcPherson 5 !Working with modules under Linux
3 IanMcDonald 6
7 To load a module into memory the format of the command is:
8 <pre>
9 modprobe modulename
10 </pre>
11
12 To remove a module from memory the format of the command is:
13 <pre>
14 modprobe -r modulename
15 </pre>
16 NB You cannot always remove a module, especially if in use or module removing has not been compiled into the [Kernel]
17
18 To see a list of all modules installed on the system:
19 <pre>
20 modprobe -l
21 </pre>
22 NB this does not show the modules running on the system. To do this type:
23 <pre>
24 lsmod
25 </pre>
26
27 !Kernel options for modules.
28 There are a number of options you can alter for modules you can alter when building the kernel under "Loadable Modules Support" that may be use for you if you are [Kernel] developer.
4 IanMcDonald 29
5 JohnMcPherson 30 !Module options
31 Many modules take options when they are loaded. You can use
32 <pre>
33 modinfo ''modulename''
34 </pre>
35 to see the list of supported options for a particular module.
36
7 JohnMcPherson 37 To specify the options for a module on many [LinuxDistribution]s on a 2.6 series LinuxKernel edit one of the files in the directory <tt>/etc/modprobe.d/</tt> and use a line something like:
6 IanMcDonald 38 <pre>
39 options ov51x led2=0
40 </pre>
41 where the above example sets the led2 option to 0 for the ov51x module.
42
7 JohnMcPherson 43 On a 2.4 series kernel, these settings go into <tt>/etc/modules.conf</tt>
44 instead. (On Debian-based systems using a 2.4 kernel, put your settings into a file in the <tt>/etc/modutils/</tt> directory and then run <tt>update-modules</tt> to re-create the modules.conf file.)
45
46 Regardless of which kernel you are running,
47 you will need to unload and then load the module for new parameters to take effect.
3 IanMcDonald 48
49 ----
50 See also KernelErrorMessages for some errors related to modules, and ModuleInitTools for information about modules with [LinuxKernel2.6].