TimeLinux1

Sunday, February 6, 2011

Linux: kernel Part - 3

This is the 3rd and final discussion about Linux kernel, focussing on kernel modules:

-LKM or loadable kernel modules allow adding and removal of modules to the kernel while the kernel is running.
-this gives the kernel more flexibility and efficiency.
-loadable kernel modules are usually stored in the dir /lib/modules/`uname -r`
-useful loadable module cmds:
    . lsmod        -    shows currently loaded modules
    . insmod    -    lets insert modules manually
    . modprobe    -    a wrapper around insmod, semi-automatic, based on /etc/modprobe.conf.
    . modprobe -c    -    to generate new modprobe.conf file
    . rmmod        -    removes modules

-in the days of the yore, when systems had few devices, their device files were simply put in /dev
-as the number of devices increased, soon /dev dir become chaotic
-to make it simple to manage devices 'udev' was created.
-udev is a device management system that runs in the user-space instead of kernel-space.
-udev maintains devices on behalf of /dev
-ie /dev does not need to have thousands of files to begin with, instead udev creates and removes them in /dev as needed.
-udev does this with the help of the 'sysfs' fs.
-sysfs is an in-memory virtual fs that was introduced in kernel 2.6.
-sysfs info is found in /sys
-/sys  holds device  specific info
-/proc holds process specific info
-going back to udev, udev is managed via the 'udevadm' cmd.
-udevadm accepts six commands 'info, trigger, settle, control, monitor, test'
-the master config file for udev is /etc/udev/udev.conf
-man pages for udevadm have more info.

No comments:

Post a Comment