Thursday, November 1, 2007

FreeBSD- compile & install kernel

I am writing here after a very long time ..yeah coz of course work I hardly get time... When the sem started I had no clue what i will be studyin in my OS course but we were made to study FreeBSD deisgn & arch... I now i must say : "I am lovin it". I didn't know what a kernel was & how it worked until I saw the kernel code...
I will be posting a series of imp info on freeBSD and all I know.. I might be wrong at times coz m still studyin it...

The first step one must know is how to compile and install the kernel on freeBSD..
1.
#make -DNOCLEAN buildkernel KERNCONF=MYKERNEL
the -DNOCLEAN allows you to avoid the complete compilation of kernel and compiles only those files that have been modifies. i.e. helps you in avoiding clean compilation
2.
#make installkernel KERNCONF=MYKERNEL
this installs the kernel..
3.
#reboot

the system makes a copy of your old kernel /clean kernel in boot/kernel.old/kernel

Now when you reboot, just let the system use the new copy of your kernel

If you wish to rollback to the old configuration u may choose option "6" from the menu that comes during the booting process .... For this just press "6" .
When u get OK prompts type

OK unload kernel
OK boot boot/kernel.old/kernel

& u r back to the old copy of kernel...yeah the code changes you made will still be there & u need to remember what all changes to did....

my suggestion : When you make change & reboot.. come back to the old copy again to make changes so that the clean copy of kernel remains there...if u make changes to the modified copy & install the changes.. you will loose the clean kernel as u will have a dirty copy of kernel in kernel.old.

there is a lot more to come...
thanx to Dr chapin...

njoy!!!!
Vaibhav ..
Life is all about innovation & quality .....

2 comments:

Singh, Harmohan said...

Hello If you share code for projects before submittion dates that would be great deal!! :P

vaibhav said...

sorry dude...jst got late...