2001-10-25 15:25:51

by Patrick Ouellet

[permalink] [raw]
Subject: In great need


Hi to you all great Linux Kernel maintainers.

As a follower of linux for a couple of years now
I wanted to go deeper into the madness,
so I said to myself, why no go as deep as you
can and get yourself into the Kernel.

My simple question is this:

Were should I start.
I would like to have a nice overview of the kernel
something that would help me understand all the part
of the kernel and how they work toghether.

If anyone could tell me where I could get
such information.. I would be pleased.

Thanx to you all and keep up the good work.

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Patrick Ouellet - Programmeur S?nior
[email protected]
Recherche & Devloppement
Les Entreprise Microtec inc.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"First they ignore you. Then they laugh at you.
Then they fight you. Then you win."
-Mohandas Gandhi
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
All source code included (if any ) is
copyright Microtec Technologies Inc. 2001
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


2001-10-25 15:58:50

by Rik van Riel

[permalink] [raw]
Subject: Re: In great need

On Thu, 25 Oct 2001, Patrick Ouellet wrote:

> As a follower of linux for a couple of years now
> I wanted to go deeper into the madness,
> so I said to myself, why no go as deep as you
> can and get yourself into the Kernel.
>
> My simple question is this:
>
> Were should I start.

A good place to start would be http://kernelnewbies.org/
and also the kernelnewbies mailing list and IRC channel.

> I would like to have a nice overview of the kernel
> something that would help me understand all the part
> of the kernel and how they work toghether.

The book "Understanding the Linux Kernel" by O'Reilly
is nice, also see http://kernelnewbies.org/books.php3

regards,

Rik
--
DMCA, SSSCA, W3C? Who cares? http://thefreeworld.net/

http://www.surriel.com/ http://distro.conectiva.com/

2001-10-25 16:14:10

by John Weber

[permalink] [raw]
Subject: Re: In great need

I am a newbie/wannabe kernel hacker too :).

Here are the steps I plan to take:

[1] Take an Operating Systems class (or read through the
syllabus materials).
[2] Write a small operating system (to learn the stuff
that OS courses/books don't teach... for example, it
took me a while to realize where the BIOS loads the
MBR... thank god lilo is open source).
[3] Learn a little about hardware and hardware
standards like PCI, PCMCIA, ACPI, USB, etc.
[4] Read Oreilly's "Understanding the Linux Kernel".
[5] Read the linux-kernel FAQ and archives
[6] Read [email protected] (No Posting!)
[7] Read linux source code
[8] Read [email protected] (Post at Will!!)
[9] Identify an area of need
[10] Write code
[11] Sacrifice a virgin pigeon and drink milk of an
albino goat....

You are now a kernel hacker.

I'm at step 2... perhaps as I go further a few of the
steps will disappear :). Just my $0.02.

Patrick Ouellet wrote:
>
> Hi to you all great Linux Kernel maintainers.
>
> As a follower of linux for a couple of years now
> I wanted to go deeper into the madness,
> so I said to myself, why no go as deep as you
> can and get yourself into the Kernel.
>
> My simple question is this:
>
> Were should I start.
> I would like to have a nice overview of the kernel
> something that would help me understand all the part
> of the kernel and how they work toghether.
>
> If anyone could tell me where I could get
> such information.. I would be pleased.
>
> Thanx to you all and keep up the good work.
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==
> -=-=-=-=-=-=
> Patrick Ouellet - Programmeur S?nior
> [email protected]
> Recherche & Devloppement
> Les Entreprise Microtec inc.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==
> -=-=-=-=-=-=
> "First they ignore you. Then they laugh at you.
> Then they fight you. Then you win."
> -Mohandas Gandhi
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==
> -=-=-=-=-=-=
> All source code included (if any ) is
> copyright Microtec Technologies Inc. 2001
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==
> -=-=-=-=-=-=
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel"=
> in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2001-10-25 16:34:37

by Jonathan Corbet

[permalink] [raw]
Subject: Re: In great need

> Were should I start.

KernelNewbies.org is intended to be a starting place for kernel hackers.

May I also humbly suggest _Linux_Device_Drivers_? It's online at

http://www.xml.com/ldd/chapter/book/index.html

But, of course, you'll want to buy a copy at the bookstore of your choice
as well :)

jon

Jonathan Corbet
Executive editor, LWN.net
[email protected]

2001-10-25 18:52:00

by Daniel Phillips

[permalink] [raw]
Subject: Re: In great need

On October 25, 2001 05:58 pm, Rik van Riel wrote:
> On Thu, 25 Oct 2001, Patrick Ouellet wrote:
>
> > As a follower of linux for a couple of years now
> > I wanted to go deeper into the madness,
> > so I said to myself, why no go as deep as you
> > can and get yourself into the Kernel.
> >
> > My simple question is this:
> >
> > Were should I start.
>
> A good place to start would be http://kernelnewbies.org/
> and also the kernelnewbies mailing list and IRC channel.

Highly recommended.

> > I would like to have a nice overview of the kernel
> > something that would help me understand all the part
> > of the kernel and how they work toghether.
>
> The book "Understanding the Linux Kernel" by O'Reilly
> is nice, also see http://kernelnewbies.org/books.php3

More than nice, I'd say essential. Even though it's based on the 2.2 series
it's still 95% relevant.

Here's the best place to start:

http://lxr.linux.no/source/init/main.c#L793

--
Daniel

2001-10-25 19:36:47

by EvilTypeGuy

[permalink] [raw]
Subject: Re: In great need

On Thu, Oct 25, 2001 at 08:52:01PM +0200, Daniel Phillips wrote:
> On October 25, 2001 05:58 pm, Rik van Riel wrote:
> > The book "Understanding the Linux Kernel" by O'Reilly
> > is nice, also see http://kernelnewbies.org/books.php3
>
> More than nice, I'd say essential. Even though it's based on the 2.2 series
> it's still 95% relevant.

The 2nd edition is updated for 2.4...(2nd edition is in print, don't know if
it's on that site...)

2001-10-25 19:45:18

by Jonathan Corbet

[permalink] [raw]
Subject: Re: In great need

> > > The book "Understanding the Linux Kernel" by O'Reilly
> > > is nice, also see http://kernelnewbies.org/books.php3
> >
> > More than nice, I'd say essential. Even though it's based on the 2.2 series
> > it's still 95% relevant.
>
> The 2nd edition is updated for 2.4...(2nd edition is in print, don't know if
> it's on that site...)

I think you're thinking of _Linux_Device_Drivers_. The authors are working
on an updated edition of the kernel book, but it's not out yet.

jon

Jonathan Corbet
Executive editor, LWN.net
[email protected]

2001-10-25 19:51:38

by Tahar

[permalink] [raw]
Subject: Re: In great need

Jonathan Corbet wrote:
>
> > > > The book "Understanding the Linux Kernel" by O'Reilly
> > > > is nice, also see http://kernelnewbies.org/books.php3
> > >
> > > More than nice, I'd say essential. Even though it's based on the 2.2 series
> > The 2nd edition is updated for 2.4...(2nd edition is in print, don't know if
> > it's on that site...)
>
> I think you're thinking of _Linux_Device_Drivers_. The authors are working
> on an updated edition of the kernel book, but it's not out yet.

The second edition of _Linux_Device_Drivers_ is out and it is online on
: http://www.xml.com/ldd/chapter/book/

Tahar

2001-10-25 20:08:48

by EvilTypeGuy

[permalink] [raw]
Subject: Re: In great need

On Thu, Oct 25, 2001 at 01:45:28PM -0600, Jonathan Corbet wrote:
> > > > The book "Understanding the Linux Kernel" by O'Reilly
> > > > is nice, also see http://kernelnewbies.org/books.php3
> > >
> > > More than nice, I'd say essential. Even though it's based on the 2.2 series
> > > it's still 95% relevant.
> >
> > The 2nd edition is updated for 2.4...(2nd edition is in print, don't know if
> > it's on that site...)
>
> I think you're thinking of _Linux_Device_Drivers_. The authors are working
> on an updated edition of the kernel book, but it's not out yet.
>
> jon

Yes, but the understanding linux kernel does include some material on 2.4,
granted it's mostly previews of the 2.4 arch, but it's there nonetheless...

2001-10-25 20:09:38

by Daniel Phillips

[permalink] [raw]
Subject: Re: In great need

On October 25, 2001 06:34 pm, Jonathan Corbet wrote:
> > Were should I start.
>
> KernelNewbies.org is intended to be a starting place for kernel hackers.
>
> May I also humbly suggest _Linux_Device_Drivers_? It's online at
>
> http://www.xml.com/ldd/chapter/book/index.html
>
> But, of course, you'll want to buy a copy at the bookstore of your choice
> as well :)

Yes, that's where I started. Being somewhat impatient, I just flipped to
chapter two, which has a 4 line example of a kernel module which I'll
paraphrase here:

#define MODULE
#include <linux/module.h>

int init_module(void) { printk("Hello kernel!\n"); return 0; }
void cleanup_module(void) { printk("Goodbye kernel!\n"); }

Then I did (more or less):

cc -c hello.c -I/usr/src/2.4.12/include
su
insmod hello.o
dmesg
lsmod
rmmod hello
dmesg
lsmod

So my first kernel hack took about 5 minutes, with the help of this book.
Note: some of that 5 minutes was spent figuring out that kernel messages
don't get printed to the console if you're running X, hence the dmesg's.

You'll have to update the example in the book - simply doing "cc -c hello.c"
works only when the /usr/include/version.h happens to match your running
kernel, which isn't very likely.[1]

The big advantage of starting with module programming is, you don't
necessarily have to understand the entire kernel to get started - the
interfaces available to modules tend to be easier to understand and work with
than the other, often subtle and sparsely documented interfaces used
internally by the kernel itself.

And yes, I do have to go out and get the 2nd edition of LDD, co-starring you
:-)

[1] Because /usr/include/linux is no longer allowed to symlink to
/usr/src/linux/include/linux.

--
Daniel

2001-10-25 20:13:18

by Robert Love

[permalink] [raw]
Subject: Re: In great need

On Thu, 2001-10-25 at 16:08, EvilTypeGuy wrote:
> > I think you're thinking of _Linux_Device_Drivers_. The authors are working
> > on an updated edition of the kernel book, but it's not out yet.
> >
> > jon
>
> Yes, but the understanding linux kernel does include some material on 2.4,
> granted it's mostly previews of the 2.4 arch, but it's there nonetheless...

True, it does have a paragraph or two at the end of each chapter on what
2.4 is including, but its still entirely a 2.2 book otherwise. Also,
there is no 2E so I can understand the confusion. On the other hand,
Linux Device Drivers does have a 2E, and it is 2.4 oriented.

Regardless, I think both books are great.

Robert Love

2001-10-26 16:38:11

by Hong Hsu

[permalink] [raw]
Subject: Re: basic questions of memory management

Rik van Riel wrote:

> On Thu, 25 Oct 2001, Patrick Ouellet wrote:
>
> > As a follower of linux for a couple of years now
> > I wanted to go deeper into the madness,
> > so I said to myself, why no go as deep as you
> > can and get yourself into the Kernel.
> >
> > My simple question is this:
> >
> > Were should I start.
>
> A good place to start would be http://kernelnewbies.org/
> and also the kernelnewbies mailing list and IRC channel.
>
> > I would like to have a nice overview of the kernel
> > something that would help me understand all the part
> > of the kernel and how they work toghether.
>
> The book "Understanding the Linux Kernel" by O'Reilly
> is nice, also see http://kernelnewbies.org/books.php3
>
> regards,
>
> Rik

Rik,

I have basic questions regarding virtual address space and memory
management, wondering you can give a help.

1. When userland process is created, how big the size of virtual
address space the kernel assign to it, 4GB or it depends on size of the
executable code? If 4GB is used, why is that because 3GB of it will be
used excessively for the process and it is huge for most of programs.

2. Upon the creation of a userland process, a Page Table and a Page
Directory will be created in main memory and stay there until the
process is terminated. Besides that the /proc will have corresponding
subdirectory for the process. Does the virtual address space has a copy
of executable code on the secondary memory, usually on hard disk, or it
just contains tables which holds addresses of executable code? Having
a copy of every executable code on hard disk could take a lot of space
if 3GB is used for each.

3. If I have enough main memory, I notice that the size of swap
(maximum is 128 MB) always zero. Does that means no virtual address
space on hard disk?

4. In Windows 98/ME, upon the termination of a userland process, this
portion of occupied main memory doesn't get released, instead the main
memory still hold contents of processes until page fault handler forces
it out. Does Linux kernel use similar approach. If so, how these
contents of processes in main memory can be reused assume same program
starts to run again as the Page Table and Page Directory are gone?

5. In your 'Memory Management Talk', you mentioned the main memory is
very slow. As speed of Intel processor grows rapidly, speed difference
between cpu and main memory is getting big and bigger. How the issue
could be solved in future? Does RAM reached its limitation of speed
theoretically or L2 cache reached its limitation in terms of cost and
size?

Maybe I confuse some concepts here. Thanks you for the help,
-Hong
[email protected]