Sunday, September 23, 2007

Compiling a 2.6.XX.XX kernel

Today I was determined to compile my own kernel as I wanted to try out some stuf related to the kernel hacking.
Here I will be mentioning some of the steps which are essential for compiling a kernel.

1) first of all be sure that you have the latest kernel source code on your linux machine. You may want chack that out on www.kernel .org . It maintains all the list of kernels. Download the latest 2.6.XXXX kernel source from there and untar in on ur system.
2) once you have the kernel source on your system, move to the /usr/src dir. Create a softlink here to the dir where your kernel source is kept.
for eg: if u saved your kernel source code at target = /home/mykernel_source/linux2.6.22.5/ , then create ln -s linux.
this will allow you to access the dir from the /usr/src/linux. :)

3) Once the above procedure is complete, you are ready to start compiling your own kernel.

follow the link : http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#CONFIGURATION to actually start compile-work.

see that you need to do few extra steps like copying your .config file to the current /usr/src/linux dir. DOing this you dont need to worry about configuration section mentioned in the link. You simply need to run ---> make menuconfig and without doing any changes there, simply do save & exit from the display window. THis is because you have already copied .config file to your linux which is already configured according to your system configuration by the already installed distribution linux. THis saves your work !!! :)

4) After configuration move on to the build section of the link mentioned above (in 2.6 section).
run a) make bzImage b) make modules c) make modules_install (As root).
For related explaination see the link.
(it takes approx 1:15- 1:30mins for the above steps, so be patient. :) )

5) Once, u are upto here u are left with configuring RAMDisk. DO it as per mentioned in the link.
6) copy the bzImage & System.map to /boot as mentioned in the link...

7) Now goto /usr/grub/grub.conf and edit this file as per the link. It will allow grub to load your newly created linux image.

8) reboot the system,select your linux there & you are done with the work :)
njoy!!!!

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Let me know, if you are faced problems while following the above steps.

-gopal

Thursday, August 9, 2007

First words

WIll be updating this one shortly with lots and lots of technical stuff.
wait......
:)

-gopal