Exploring Linux kernel

11:08:00 PM 0 Comments

Exploring Linux kernel

by vivek

Here are some interesting facts about running Linux kernel. Following information is quite useful if you are planning to compile your own custom kernel :)

But where is my kernel stored?
Your compiled kernel is always installed in /boot directory:

Here is listing of all installed kernel in my system (filename -> description)
$ ls -l /boot/

  • config-2.6.12-1-386 --> Kernel configuration file generated by make menuconfig/make xconfig/make gconfig
  • System.map-2.6.12-1-386 --> This file has a map of positions of symbols in the kernel. Device driver such as USB pen uses hot plug, which depend upon symbols generated by depmod utility
  • vmlinuz-2.6.12-1-386 -- > Actual Kernel file
  • initrd.img-2.6.12-1-386 --> Contains device drivers which are required to boot and load rest of operating system from disk. Usually SCSI and IDE drivers are stored in this file
  • grub --> It is a directory, which stores grub Boot loader configuration file
  • config --> Soft link to current kernel configuration file
  • vmlinuz -> Soft link to current running kernel file
  • System.map --> Soft link to current running kernel system map file

But what is 2.6.12 ... yup you are right it is kernel version :D

How do I find out version of running Linux kernel?
Use any one of the following command:
uname -r
OR
cat /proc/version

How do I find out where running kernel modules (device drivers) are stored?
Use any one of the following command:
ls /lib/modules/$(uname -r)
ls -d /lib/modules/$(uname -r)

How do I load kernel modules at boot time?
/etc/modules file should contain the names of kernel modules that are
to be loaded at boot time, one per line.
$ cat /etc/modules

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard.