Boot Linux faster!

Check our new training course

Boot Linux faster!

Check our new training course
and Creative Commons CC-BY-SA
lecture and lab materials

Bootlin logo

Elixir Cross Referencer

This file describes the strategy for dynamically loadable modules
in the Linux kernel. This is not a technical description on
the internals of module, but mostly a sample of how to compile
and use modules.

In this kernel you also have a possibility to create modules that are
less dependent on the kernel version.  This option can be selected
during "make config", by enabling CONFIG_MODVERSIONS.
Note: If you enable CONFIG_MODVERSIONS, you will need some utilities
      from the latest module support package: "modules-1.1.8*.tar.gz"!

Anyway, your first step is to compile the kernel, as explained in the
file README.  It generally goes like:

	make config
	make dep
	make clean
	make zImage or make zlilo

In "make config", you select what you want to include in the kernel.
You will generally select the minimal set that is needed to boot:

	The filesystem of your root partition
	A scsi driver, but see below for a list of SCSI modules!
	Normal hard drive support
	Net support (CONFIG_NET)
	TCP/IP support (CONFIG_INET), but no drivers!

	plus those things that you just can't live without...

What has been left out is generally loadable as a modules.
The set of modules is rapidly increasing, but so far these are known:

	Most filesystems: minix, xiafs, msdos, umsdos, sysv, isofs

	Some SCSI drivers: aha1542, in2000

	Some ethernet drivers:
		plip, slip, dummy,
		de600, de620
		3c501, 3c509
		eexpress, depca,
		ewrk3, apricot

	Most CDROM drivers:
		aztcd:     Aztech,Orchid,Okano,Wearnes
		cm206:     Philips/LMS CM206
		gscd:      Goldstar GCDR-420
		mcd, mcdx: Mitsumi LU005, FX001
		optcd:     Optics Storage Dolphin 8000AT
		sbpcd:     Matsushita/Panasonic CR52x, CR56x, CD200,
		           Longshine LCS-7260, TEAC CD-55A
		sonycd535: Sony CDU-531/535, CDU-510/515

	Some misc modules:
		lp: line printer
		binfmt_elf: elf loader

When you have made the kernel, you create the modules by doing:

	make modules

This will compile all modules and update the modules directory.
In this directory you will then find a bunch of symbolic links,
pointing to the various object files in the kernel tree.

As soon as you have rebooted the newly made kernel, you can install
and remove modules at will with the utilities: "insmod" and "rmmod".


Now, after you have made all modules, you can also do:

	make modules_install

This will copy all newly made modules into subdirectories under
"/lib/modules/kernel_release/", where "kernel_release" is something
like 1.1.83, or whatever the current kernel version is...


Nifty features:

If you have installed the utilities from "modules-1.1.8*.tar.gz",
you will have access to two new utilities: "modprobe" and "depmod"

Using the modprobe utility, you can load any module like this:

	/sbin/modprobe module

without paying much attention to which kernel you are running.
To use modprobe successfully, you generally place the following
command in your /etc/rc.d/rc.S script.

	/sbin/depmod -a

This computes the dependencies between the different modules.
Then if you do, for example

	/sbin/modprobe umsdos

you will automatically load _both_ the msdos and umsdos modules,
since umsdos runs piggyback on msdos.


Written by:
	Jacques Gelinas <jacques@solucorp.qc.ca>
	Bjorn Ekwall <bj0rn@blox.se>