02 Apr, 2008

Hack the Kernel - the Core of Linux

Posted by: Sachin In: Personal

We know that the center of Attraction is Kernel what makes Linux and Unix Operating systems. I am gonna Hack it. lol

Kernel- Introduction.

We know that the center of Attraction is Kernelwhat makes Linux and Unix Operating systems. The Mediator which is between your program and hardware components. The Kernelhas direct access to certain services with the systems hardware which no other program has direct access to.

A program which has to carry out a special tast, it has to go to the Kernelfirst. Every program which wants to run need to ask the Kernelfor permission. This is the first step and the Kernelconsiders the program’s request and proceeds to do a number of tasks for the program. The majority of the kernel was written in C with partial implementations written in assembly language which makes the it flexible and very fast. Let me give out a nice example on how a program interacts with kernal. We shall name the program as [ Rajan app ].

Rajan app  : Hello Kernelsir! I would like to play a song from Sivaji - the Boss.
Kernel       : Cool! Granted. But be limited to your boundaries, crossing would make me to stop you.
Rajan app : Thanx a lot…..
Kernel      :  I never gave you the permission to play ” Rang dey Basanthi song “.
Rajan app : Ahhhhhhhhhhh………………….     Gatham Gatham [ Dumped ]
Kernel      : Ask me next time if you want to play that.
Kernel      : Ah its hard slog, when are these programs gonna learn the basics.

My friend asked me, whether killing the program means ………. , its actually stopping the process which has stepped out or just killing the program. Nothing is related towards crashing your linux operating system. After this it goes on to its usual business of answering requests from other process and programs.

Configuring the Kernal.

The kernel is usually compiled like other C programs using the “make” command. Make is a smart program that does most of the compilation processing using configuration information you provide via ( xconfig, config, and menuconfig — see below for more details.). So you can actually compile the program in which your hacking the kernel with.

Kernel is no expection like other C programs, its also complied using the “make” command. make is a program which does most of the compilation process using the configuration info provided via [ config , xconfig and menu config-- ].

There are few ways in which you can configure the kernal. Let me discuss out some of them here below….

make config

Its a text based program that helps you out to config the kernal. Its as simple with yes or no questions.

make menuconfig

Interactive menu configuration program, selections in the kernel are made using toggle switches.

make xconfig

An X Windows program. A graphical menu is displayed in X, and all possible options or modules are enabled/disabled with radio buttons and other common GUI interactions. ( very user friendly )

Why to configure the Kernal?

Well With your defualt installation of linux, the Kernelsize is relatively large… hmm very big. These kernals provide you with wide variety of support in the sense of device drivers. They are built because to support wide range of hardware which you may install later which can enable a direct support instead of tweakining down the core.

Bigger Kernelmeans longer boot time and less memory for your applications to run in.Hacking and reconfiguring the kernel is used for cleaning out, and getting rid of extra drivers and options not needed for your system. Once you have hacked out the unused materials your kernel will be faster, cleaner and more efficient to run.

1 Response to "Hack the Kernel - the Core of Linux"

1 | KayzZ

June 12th, 2008 at 9:08 pm

Avatar

hw r u goin 2 du dat…

Comment Form

Flickr PhotoStream

About Me!

In short, my name is Vinoth babu { perra kettala summa authrithala } a software engineer from India, Chennai.

I am a die hard fan of Superstar RajiniKanth and AR Rahman.