Skip to contentSkip to conversation

In great need

DISCUSSION Patrick Ouellet 8 participants 11 messages Oct 25, 2001 – Oct 26, 2001

lore
Share & tools
lore
#0 lore raw

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.

Signature · 13 lines
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#1 lore raw
Quoted 8 lines · Patrick Ouellet

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.

Quoted 3 lines

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

Signature · 3 lines
DMCA, SSSCA, W3C?  Who cares?  http://thefreeworld.net/

http://www.surriel.com/		http://distro.conectiva.com/
#2 lore raw
Quoted 7 lines · Rik van Riel
Quoted 5 lines · Patrick Ouellet

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.

Quoted 6 lines
Quoted 3 lines

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.

Quoted 6 lines
Quoted 3 lines

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

#3 lore raw
In reply to Rik van Riel
Quoted 6 lines · Daniel Phillips
Quoted 2 lines · Rik van Riel

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...)

#4 lore raw
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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]

#5 lore raw
Quoted 10 lines · Jonathan Corbet
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

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

#6 lore raw
In reply to EvilTypeGuy
Quoted 6 lines · Jonathan Corbet
Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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...

#7 lore raw
Quoted 7 lines · EvilTypeGuy
Quoted 4 lines

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

#8 lore raw

Re: basic questions of memory management

In reply to Rik van Riel
Quoted 18 lines · Rik van Riel
Quoted 8 lines · Patrick Ouellet

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.

Quoted 3 lines

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.

Quoted 6 lines

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]

#10 lore raw
Quoted 10 lines · Jonathan Corbet
Quoted 1 line

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