TimeLinux1

Sunday, February 6, 2011

Linux: kernel Part - 2

This is the 2nd discussion about Linux kernel, focussing on device management:

-most devices except the n/w devices have a corresponding device file in /dev dir.
-each device file has a major and minor number.
-the major number helps the kernel identify the type of device (eg usb drive).
-the minor number helps the kernel identify the instance of a particular device (eg one of multiple usb drives).
-device files can be block or character device files.
-block device files read one block at a time (usually 512 bytes).
-char  device files read one byte  at a time.
-besides having 'real' devices, you can have pseudo devices too created by h/w abstraction.
-eg of pseudo devices are pseudo terminal (pty, pts), /dev/zero, /dev/null, /dev/random.
-linux device drivers are usually distributed as package or kernel patch.
-device files are created using mknod cmd.
-eg:    # mknod  filename type major minor
-in linux, the udev system manages the dynamic creation and removal of devices (eg: usb drives).

-whenever possible, the default kernel is preferable than customized rebuilt kernels for manageability & support.
-for persistent kernel parameter changes across reboots, edit /etc/sysctl.conf.
-kernel.org is the one source for latest linux kernel developments.
-good system admin practice guides that patches be applied only if relevant.

-linux kernel rebuild from source involves of the foll steps:
-downloading new source code in /usr/src
-configuring the .config file directly or via make gconfig or make menuconfig cmd.
-running make clean followed by make.
-copying new image to /boot/vmlinuz foll by adding new kernel line to grub.conf.

No comments:

Post a Comment