DistributedNetworksDistributedNetworks





Compiling Kernel   «Prev  Next»
Lesson 5 Supporting module configuration
Objective Configure kernel modules.

Supporting Linux Module Configuration in Redhat

Some modules require configuration information, such as the SoundBlaster module (sb), which accepts
  1. irq,
  2. dma, and
  3. io parameters.
Because modules might be loaded without human intervention, the /etc/conf.modules file stores default values for various modules' parameters.
When modprobe loads a module, it consults this file for appropriate defaults. Aliases for various modules also can be specified in the /etc/conf.modules file, as can shell commands to be executed when loading or unloading modules.
Every line in the /etc/conf.modules file specifies a directive, which is simply an instruction to modprobe when it consults this file. Directives begin with a keyword specifying their function, such as alias to alias names of modules or options to specify a module's options.

For example:
 pre-install pcmcia_core /etc/rc.d/init.d/pcmcia start
 alias eth0 tulip
 options sb io=0x220 irq=7 dma=0 mpu_io=0x300

The first line tells modprobe to run the /etc/rc.d/init.d/pcmcia start command before loading the pcmcia_core module.
The second line tells modprobe that references to the name "eth0" really refer to the tulip module.
Finally, the last line sets various options for the SoundBlaster modules.
For a full list of /etc/conf.modules supported syntax, check the man page for conf.modules.



Question: What is the Linux command that allows you to load kernel modules manually?
Answer: modprobe

Reconfiguring the kernel

When you install Red Hat Linux, the kernel (which represents the core of the operating system) is automatically configured for you and ready to run. Many assumptions are built into this kernel, including the types of drivers that you will need to run your hardware and the services that the kernel provides.
There are times when you may want to change these assumptions. To do that, you can reconfigure your kernel.
Note: Not all changes to the features in your kernel require that you rebuild it. Many drivers are available to an installed Red Hat Linux system in the form of loadable modules. Loadable modules can be used to add features to a running kernel.
For example, the PCMCIA feature uses loadable modules. You can use the insmod and modprobe commands to load modules that you need. Reconfiguring your kernel is a tedious job. It consists of answering a lot of questions (some of which you will have no idea how to answer). In most cases, the kernel configuration process has defaults set up. So, if you run into a question you cannot answer, press Enter to use the default. Kernel configuration also takes time.
The Kernel-HOWTO suggests that the process can take from 20 to 90 minutes, depending on hardware. To simplify the process of reconfiguring your kernel, the xconfig option to make for rebuilding the kernel offers a graphical interface. Using make xconfig, you can focus on the drivers you want to add and remove, instead of having to page through all the drivers.
The next lesson describes the pros and cons of rebuilding your kernel.

Kernel Modules - Quiz

Before moving on to the next lesson, click the Quiz link below to check your understanding of kernel modules and concepts.
Kernel Modules - Quiz