Why would you use a module?
- Testing new kernel code. You can edit the module source,
compile, load it, test it, unload it and repeat. No need to reboot
your system every time.
Danger Will Robinson: Badly written module code can
crash your system - you have access to everything. It is a good idea
to remount your file systems in read only mode when testing modules.
mount -o remount,ro /home
mount -o remount,ro /usr
- To get control over where hardware is mapped, especially with
multiple network cards. If drivers are built into the kernel then they
are assigned in the order that the kernel probes them, this is fixed by
the linkage order. With modules you can control the load order which
in turn controls the probe sequence.
- Build one kernel to handle multiple machines with different
hardware. Instead of building a specific kernel for each machine,
build a common base and use modules to handle different network, sound
- Linux distributors use modules extensively. The typical install
procedure for a new distribution uses a minimal kernel with a lot of
modules. It will work out which hardware you have and then load the
modules to run your hardware.
- Licencing. Until the recent BSD licence change, code that was
under the BSD copyright could not be linked into the kernel, it had to
be built as a module. PPP compression routines fell into this
- Pluggable hardware (PCMCIA, USB) is easier to handle with
©Keith Owens O. C. Software P/L 2000