Ive always had an interest in robotics and embedded systems, basically anything with a computer in, with this came my interest in computer security. And along the way i some how managed to form a love for Linux, and all that it stands for

So basically if you muddle all these interest up you get and interest in building your own Linux distro for embedded/ robotics purposes.

Ive read the Linux from scratch project and even started building my own (still needs to be finished) and just recently ive become interest in really small versions for use in Microprocessors and other stuff.

Busybox is a program thats pretty amazing, basically it can replace the large amounts of GNU/Linux command line tools with a package that is between 256-500k, pretty cool aye? I plan on using on my final version, but im not really going to go into great depths about busybox, theres a great tutorial over at the linux journal about making a single-floppy based linux distro using busybox.

So where does the kernel come in!? Well basically the kernel installed on most desktops/ laptops, has allot of bits that I wouldnt need for an embedded system, I can compile my own kernel and save space.

Recompiling your kernel need not be becuase you wanna put it on something else, theres a few other reasons why you'd wanna do it to -->

1)you might have hardware thats real new and not supported by your current kernel so you need to download a new one from http://www.kernel.org/pub so you can get you pretty new hardware dancing.

2)Bugs! you might find a bug thats on the old one but not on the latest version

3)A new piece of software might need the shiney new kernel

4)You just feel like experimenting

Before i came to compile the kernel, I saw it as sort of a blackart as there were massive tutorials about it that didnt actually seem to help greatly, But when I sat down and did it after getting over my initial fears of thinking its gonna go majorly wrong and muck up everything, I was happily surprised at how easy it was

Ohh yea whats the kernel!? for those that dont know the kernel is the piece of code at the base of the OS, It basically provides all the services to the rest of the Linux Distro.

I hold no responsiblity for your mistakes. If you make um, you fix um. youll learn more that way :-) thats how i got to university, by breaking and mending stuff


tip: - The kernel code is quite a large download 21mb, thats if you havent already got it on a distribution disk, which you should have. So my top tip is if your on 56k (get your arse in gear BT and upgrade the exchange, if you wont give me the stuff and ill do it :-)) like I am, then you can get the latest kernel off the CD's on the Linux magazines

Rite lets do this kernel thing!

Copy the tarball to your directory : -

me@knakeredbox:~$ mount /mnt/cdrom
me@knakeredbox:~$ cd /mnt/cdrom/where_ever_the_kernel_tar_ball_is
me@knakeredbox:/mnt/cdrom/where_ever_the_kernel_tar_ball_is$ cp linux-2.4.xx.tar.bz2 /home/me/mykernel

me@knakeredbox:~$ cd /home/me/mykernel
me@knakeredbox:/home/me/mykernel$ tar jxf linux-2.4.xx.tar.bz2

me@knakeredbox:/home/me/mykernel$ make mrproper
me@knakeredbox:/home/me/mykernel$ make menuconfig

The last to bits of this basically build a few programs and the final one pops up a window, this is where you can change your kernel, add bits, take bits away. Once id done this i saved it in my /home/me/mykernel file, as i didnt wanna upgrade the existing one with the other option, if thats what you wanna do then i suppose you could do that but theres another way.

the next bit basically builds bits and pieces of and for the kernel,

me@knakeredbox:/home/me/mykernel$ make dep; make clean

the first part builds the dependencies, the next bit make clean sorts out files that are now not needed.

me@knakeredbox:/home/me/mykernel$ make zImage

or

me@knakeredbox:/home/me/mykernel$ make bzImage

Now this is the bit im not 100% on, I think the top on Build the kernel for a normal system and the bottom one for a bootable floppy, If im wrong here then please correct me :-)

this process can take 20minutes on an old pentium 120, and only took about 3-5 mins on my 800 athlon, so its not to bad.

the next step is to make the modules, this is simpley done with

me@knakeredbox:/home/me/mykernel$ make modules

this doesnt take as long as the previous command.

So this is where i would stop becuase i wouldnt wanna install it onto my embedded system jsut yet, but i gave it a go on an old pent 120Mhz, just to experiment.

so heres how to sort the install,

basically on most boxs the kernel needs to be in /boot. so this can simply be done by copying it as such

me@knakeredbox:~$ cp /home/me/linux-2.4.21/arch/i386/boot/zImage /boot/shineynewkernel

me@knakeredbox:~$ make modules_install

this squares away the modules into /lib/modules

the final step is to open /etc/lilo.conf to add a new it like this,

image = /boot/shineynewkernel
label = new
read-only

save it, reboot and then select new and this should load the new kernel, ive had no experience at fault find this if it goes wrong, i think the computer gods liked me today :-)

hopefully this has contributed something of us to someone, I found it quite interesting and it dug me deeper in, in my understanding of how things work,

I wanna have a look at someof those other things in the kernel compnents adding screen such as the ham radio and the likes, but thats for another day as my laptops heating my legs up to a temperature exceeding pleasent :-)

i2c