[TAG] Starting to explore the Linux kernel code

Ramon van Alteren ramon at vanalteren.nl
Fri Jun 9 02:43:06 MSD 2006


Deepak Mishra wrote:
> Hello Everyone ( Answer Gang),
> I have gone through the basics of OS and now trying to explore and
> understand the linux kernel code.
> I am confused from where I should start.
> Just to make my life easier, I am thinking to to document the function
> calls from the login prompt to bash or any shell prompt.
> 
> Then I want to go in reverse direction and find out how I came up to a
> log in prompt.

Although it sounds like a nice idea to start with linux kernel source
code, logging in doesn't really use the kernel code much. (Or it does
but in a very different way then you seem to assume)

You might want to start by having a look at the linux bootproces and
understanding the role that the kernel fills in this proces.

Recently someone published a nice overview of the boot process on the
ibm developerworks site:
http://www-128.ibm.com/developerworks/linux/library/l-linuxboot/?ca=dgr-lnxw06LinuxBoot

Additionally I always found the linux from scratch project an excellent
resource on the ecosystem that the linux kernel + the (GNU) userland
tools  & programs really is.

You can find it here: http://www.linuxfromscratch.org/

> I have 3 questions.
> 1. Is this approach to understand the linux kernel code all right?

No, see above. Basically the kernel handles access to the hardware
resources in an uniform way and offers hooks for user-space programs to
get access to these resources. You will find that the login process is
handled by a program that calls the kernel to get access to the
appropriate resource (filesystem, screen, keyboard, serial line, whatever)

> 2. If any one can give me some hint where I can find the login related
> code or where I should start .. I will be very glad.
> 3. Is there any documentation available which I can use as reference?

See above.

If you have a spare machine lying around somewhere that you can use I
can really recommend linux from scratch. It will give you an excellent
insight in how what most people refer to as linux is actually build from
a number of different components, among them a kernel.
It doesn't have to be a high-specced machine, I originally build a linux
from scratch on an old intel 386 machine.

Hope you enjoy the ride ;-)

Ramon
+-+--------------------------------------------------------------------+-+
You've asked a question of The Answer Gang, so you've been sent the reply
directly as a courtesy.  The TAG list has also been copied.  Please send
all replies to tag at lists.linuxgazette.net, so that we can help our other
readers by publishing the exchange in our monthly Web magazine:
              Linux Gazette (http://linuxgazette.net/)
+-+--------------------------------------------------------------------+-+
_______________________________________________
TAG mailing list
TAG at lists.linuxgazette.net
http://lists.linuxgazette.net/mailman/listinfo/tag







More information about the TAG mailing list