More Kernel Chapter 4
- 0
- Add a Comment
More Kernel - Part 4
When we last met, our custom kernel was freshly compiled. Maybe I’m just sick with technology, but the Pillsbury Doughboy’s got nothing on a piping hot fresh Linux kernel. Well, maybe with the exception of those crescent roll thingies. Anyway, we’ve already walked through the process of customizing and compiling the kernel in Linux. It’s time to move on to those invaluable loadable modules.
For today’s GnomeCORE, we’ll refer back to our master kernel list of 12/18:
5. Build the loadable modules (or device drivers) that will be needed for some of your devices and/or processes. This is done with the make modules command.
6. Install these newly-built modules using make modules_install.
What are these mysterious loadable modules? The Linux OS has the ability to link device drivers directly into a running kernel. That’s the purpose these loadable modules serve - the equivalent of device drivers in Windows. Given the increasing support for various hardware devices in Linux, and the large number of drivers now available, it’s become impractical to build your kernel with every possible device driver built in. After all, the point of compiling your own kernel is to make it as small and efficient as your individual needs will allow. Loadable modules in Linux are available “on demand,” only as you see fit and necessary. You decide and define when they’re used in your Linux system.
Making and installing these modules is quite easy. You’ve already found the /usr/src/linux directory for configuring and compiling your Linux kernel. Making the modules occurs in the same directory, also as root. The modules are created based on the configuration of your kernel. Remember the choices you made in make xconfig? I know - if you’re building your first kernel, that part of the process is probably just a blur at this point. That’s everyone’s experience the first time out. But, you’ll recall that your choices in that process were to build drivers directly into the kernel, to make them loadable modules, or to leave them out altogether. Those that you chose to build into the kernel are already taken care of. You did that when you compiled the kernel. This is the point in the process in which you build those modules you selected as loadable and create the appropriate links to the kernel.
Not to sound trite, but the necessary commands for this process are exactly as they sound. It’s a sort of onomonopia for geeks, if you will. make modules builds the modules you’ve defined as loadable in your kernel configuration. make modules_install installs them in the appropriate directories and creates the necessary links for the kernel to find them when needed. Pretty simple.
Next time, we’ll move that new kernel to the appropriate directory and tell lilo how to find it when you boot your Linux system.
