Section 24.1. Kernel (Topic 1.105)


24.1. Kernel (Topic 1.105)

24.1.1. Objective 1: Manage/Query Kernel and Kernel Modules at Runtime

  • The Linux kernel is modular, and device driver software is inserted into the running kernel as needed.

  • Module files are objects, stored under /lib/modules.

  • Kernel modules can be managed using:


    insmod

    Insert a module into the kernel.


    lsmod

    List modules.


    modinfo

    Get information about a module.


    modprobe

    Insert modules along with their prerequisites.


    rmmod

    Remove a module from the kernel.

  • Modules are configured in /etc/conf.modules or /etc/modules.conf.

  • modprobe determines module dependencies using a filecalled modules.dep. This file is usually created at boot time usingdepmod.

24.1.2. Objective 2: Reconfigure, Build, and Install a Custom Kernel and Kernel Modules

  • To build a kernel, you need the compiler, assembler, linker, make, kernel source, and kernel headers.

  • These are typical kernel compilation steps, done in /usr/src/linux:

    1. Make a configuration using make oldconfig (existing setup), make config (basic interactive text program), make menuconfig (interactive text menu program), or make xconfig (graphical program). Each method creates the .config file containing kernel options.

    2. Modify EXTRAVERSION in Makefile, if desired.

    3. Build dependencies using make dep.

    4. Clean old results with make clean.

    5. Create the kernel with make bzImage.

    6. Create modules with make modules.

    7. Install the modules with make modules_install.

    8. Copy the new image to /boot.

    9. Update /etc/lilo.conf for the new image.

    10. Update the boot loader by running the lilo command.



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net