Linux Device Drivers Demystified - page 2
Another much-trumpeted advantage of Linux is that it does not need to be rebooted as often as other operating systems. You might think that this is due to its rock solid stability. You may think I am now going to talk about the quality of the device drivers. But you'd be wrong. The reason that Linux device drivers lead to less rebooting is that we can reconfigure, load or unload them without restarting the system.
To do this modular kernel drivers are used.
How to load a module
Most people configure their modules at install time and then leave them alone. All the major distributions have taken to modules because of another advantage they have: size. Distribution makers want to support all the possible cards and devices that Linux can. If we compiled all these into the kernel it would be huge. If several different static kernels for different devices were supplied then they would take up too much space, as well. With the modular system distribution makers supply a stripped down kernel plus a comprehensive set of device drivers. This typically only occupies two or three floppy disks in total.
modprobe, lsmod and insmod
if you want to load a module after system setup time, then the easiest way is as follows:
This example loads the Apple Mac disk subsystem driver (called hfs) with the modprobe command. If the module takes parameters, like IRQ numbers, then you can specify them with modprobe too.
To see what modules are loaded and to see information on how they depend on each other we use lsmod. Here is some example output from lsmod.
Module Size Used by gus 45016 0 mad16 6564 0 sb 31416 0 ad1848 15112 0 [mad16] uart401 5588 0 [mad16 sb] sound 54368 0 [gus mad16 sb ad1848 uart401]
In this example the mad16 kernel device driver depends on the ad1848 device driver.
Yes, there really is a mad16 device driver. It is a soundcard chipset.
In the normal course of events the modules we asked for when Linux was installed are loaded at boot time. To achieve this the file
/etc/modules is used. This is a list of modules to be loaded.
The options for the modules are stored in
/etc/conf.modules. Recommended practice is to not edit /etc/conf.modules, however, but to use a script like
update-modules; see the man pages for more details.
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: RHEL 6.7, BackBox Linux 4.3 and RoboLinux 8.1
- 2Linux Top 3: SLES 11 SP4, Chromixium OS 1.5 and Canonical Licensing
- 3Linux Top 3: VirtualBox 5, Point Linux 3.0 and OpenSUSE Leap 42.x
- 4Linux Top 3: Linux 4.2 rc1, 4MLinux 13 and antiX15
- 5Linux Top 3: Linux Mint Rafaela, OpenMandriva Lx 2014.2 and VectorLinux 7.1