Page 1 of 1

Multiple Kernels - Understanding

Posted: Wed Feb 27, 2013 6:51 am
by anandrkris
Hi All,

I would like to understand how Mint (per se, any other Desktop Environment) work in case of multiple kernels installed in a system. I recently upgraded my Kernel from 3.2 to 3.8 and GRUB presents both the kernels and could select either of the kernel while booting as desired.

Both kernels work on the same root and home partitions. I believe when a kernel is installed it generates an image which will store all the configurations in terms of applications installed,etc.

I will be grateful if someone can take the pains to explain / point to material on how desktop environment interfaces with kernel. Looks like desktop environment is coupled with kernle loosely enough to talk to mutilple kernels. (Non-concurrently)

I have also upgraded my KDE to 4.10 and kernel to 3.8. Also, how does Mint update manager handle and upgrade only the relevant package since I have deviated from initial installation.

Thanks for your time.

Re: Multiple Kernels - Understanding

Posted: Wed Feb 27, 2013 7:16 am
by AlbertP
The "kernel image" is a different thing than what you're describing here. It does not contain installed software, it's the kernel itself packaged into a file that bootloaders like Grub can load. The kernel image does not contain much of the kernel's hardware drivers, those are stored separately as modules in a folder inside /lib/modules/ for every kernel version.

The desktop and any other userspace software, is not linked to any kernel. The kernel, after being told what it's root partition is, just starts the "init" program of the Linux system on that partition. init in turn loads all the system components. That way you do not have to link anything to a kernel, any kernel will run init allowing all software to run. The executable files of all software, such as the desktop environment, are in a file format that allows running them on any Linux or Unix kernel (ELF for example).

Re: Multiple Kernels - Understanding

Posted: Wed Feb 27, 2013 10:38 am
by anandrkris
Thanks AlbertP for the clarification. 'init' got me started in the right direction.

After every installation or update, i think this 'initrd.img' file gets updated? This is what i wrongly assumed as some sort of an image which contains system specific / distro specific / hardware info? What does the above files contain ?

Code: Select all

anand@AnandLaptop ~ $ locate initrd.img
/initrd.img
/initrd.img.old
/boot/initrd.img-3.2.0-23-generic
/boot/initrd.img-3.8.0-030800-generic
Pls spare me for trivial questions. Am keen to learn how the OS functions.

Re: Multiple Kernels - Understanding

Posted: Wed Feb 27, 2013 11:04 am
by AlbertP
initrd contains a copy of important system files such as drivers which need to be loaded before the kernel is able to mount its root filesystem. Since the drivers are specific to a certain kernel version, every kernel version has its own initrd. The kernel images are the "vmlinuz" files the /boot folder.

The vmlinuz and initrd.img files in the root directory are actually links to files in /boot. They point to the default version used, when you boot without specifying a kernel version yourself.