Wednesday, September 24, 2008

Playing the main role

It has been a while since I have participated in a drama. If I remembered correctly, it was in University, I did my last act (on a stage of course :-)). I go to this local church in Miami, St Augustine Church, for the remembrance of the Eucharist. Today there was a small drama on Jesus life from Luck 15:4-7 for youth. Yesterday, my beloved members of the young adults group asked me whether I could act the role of Jesus Christ. The main reason they wanted me to act was, I have long hair :-). Ironic !. Well I accepted the invitation and had to prepare myself with the setting and with the script less than 24 hrs. So today I dressed up as Jesus Christ and did my part. It was the main role btw. Everything has gone as planed and it was just awesome!!!!.

Saturday, September 20, 2008

Senator Barack Obama in University of Miami

Yesterday, Friday (09/19/08) Senator Obama gave a speech in University of Miami. Friday is a good day, because I have only one class!. I had this rear privilege of getting a ticket to attend this event. These tickets were quite hard to come by.So I knew a dude who new another dude, who had an extra ticket so that I could borrow. I did actually saw "the man" himself and his speech was quite exhilarating and encouraging to his supports. His speech quite touched my chain of thoughts very very deeply. Hey, don't ask my point of view in political parties, I just like the idea of presidency :-). Good luck to you Senator Obama, I know you will just do fine.

System calls to Linux kernel

System call provides an interface to user-space processes to interact with kernel. This interface gives applications to access hardware and other operating system resources. This article gives you a good introduction to implement system calls in i 386 architecture.

It seems that _syscallX macros have been removed from "unistd.h". Hence, we have to use syscall available from libc.

Wednesday, September 10, 2008

Compiling the newest Linux kernel

This semester I'm taking an advance operating system course and as part of my first assignment I have to hack the newest Linux kernel to provide a new system call that based on Intel architecture (32 bits). I have never hacked a Linux kernel before and this assignment has opened a quite unique experience for me.

How do you compile Linux kernel 2.6.26.6

0. Before starting check whether your /boot file system is ext3. If not you might end up with a lot of custom configurations, which I haven't mentioned here.

1. Get latest Linux kernel code.
Visit http://kernel.org/
wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.5.tar.bz2


2. Extract tar (.tar.bz2)
tar xvjz linux-2.6.26.5.tar.bz2 -C /usr/src/linux-2.6.26.5

3. Configure kernel

Before doing anything else, you need to have development tools on your system. If you are using a Debian distribution you need lib6c-dev and libncursesw5-dev

Change the directory to /usr/src/linux-2.6.26.5

You have three options to get started
* make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
* make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
* make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.

I like,
make menuconfig

4. Compile kernel

Start compiling to create a compressed kernel image
make

Start compiling to kernel modules
make modules

Install kernel modules
make modules_install

5. Install kernel

So far we have compile module and installed kernel. Let's install kernel,
make install

After that change directory to /boot, you will be able to observer,
System.map-2.6.26.5
config-2.6.26.5
vmlinuz-2.6.26.5

6. Create initrd image
cd /boot

mkinitramfs -o initrd.img-2.6.26.5 2.6.26.5

7. Modify Grub configuration file - /boot/grub/menu.lst
cd /boot/grub

update-grub

Update grub is a cool way to edit the file automatically. One could use LILO instead of GRUB. Though the update utility do the job for us, it wont set the initrd. Hence,

vi /boot/grub/menu.lst

## ## End Default Options ##

title Ubuntu, kernel 2.6.26.6 Default
root (hd0,0)
kernel /vmlinuz root=UUID=c45bb5a8-11b8-4d03-aec4-4c4f070edae6 ro quiet splash
quite

...

and change it to

## ## End Default Options ##

title Ubuntu, kernel 2.6.26.6 Default
root (hd0,0)
kernel /vmlinuz root=UUID=c45bb5a8-11b8-4d03-aec4-4c4f070edae6 ro
initrd /initrd.img-2.6.26.5
savedefault
boot

...

Please note that "root" will change according to your configuration

8. Reboot computer and boot into your new kernel

reboot

Next time I'll tell you how to add a system call with a little bit of theory. Have fun!

Saturday, September 6, 2008

Zen poem

To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.