Saturday, May 8, 2010

Short-cut to the Linux kernel

These days, I begin collecting some Linux documents and information on blogs and twitter, so I can easily keep track of the information, and build up a knowledge base for later reference.

The Linux Kernel tar bar is pretty easy to obtain, compile and use. First time I did it was 10 years ago but never got a chance to seriously understand the Kernel itself, until Linux 2.6 has been out for a while, and popularly used everywhere from desktops to embedded systems. The article (http://www.ibm.com/developerworks/linux/library/l-inside.html) appears just too exciting to me with easy-to-understand discussions on so many advances in the new kernel in areas including O(1) scheduling, memory management, fast threading and mutexing. The author of many new updates in the new kernel, Ingo Molnar, bragged honestly in a KernelTrap interview that he started installing Linux around 1995 to see how to write a kernel, then became an Admin, and then a Linux user.

I started knowing Linux in the 90's too when someone in college compiled a system from source. I became the Admin of the system and a frequent user. When I finally got motivated to look at the kernel source -- it is already a huge tar ball (>64MiB in bz2 format)... Too much. I then googled the tar ball for Linux 0.11 written by Linus Torvalds himself for i386. Yep, this is a palatable 79K small tree, though it's enough to read for a couple of days or so. I think it may be the easiest way to understand the internals of the early Linux kernel -- boot, fs, devs, procs, etc. w/o headache.

The following are some links about the short-cut of understanding the Linux Kernel from its birth.

Linux 0.11 source: http://www.kernel.org/pub/linux/kernel/Historic/old-versions/
i386 IDT: http://www.acm.uiuc.edu/sigops/roll_your_own/i386/idt.html
Protected mode and paging: http://en.wikipedia.org/wiki/Protected_mode
How to write an OS: http://www.acm.uiuc.edu/sigops/roll_your_own/
An interesting experiment of using int 0x81 instead of 0x80 for syscall: http://weichong78.blogspot.com/2008/03/trap-gate-and-system-call.html

No comments:

Post a Comment