Web Links

Listed here are a number of links to web resources that should be helpful.

Elf

Hey,
	This might be of interest to you.  It describes the inner workings 
of the ELF binary executable format that Linux uses.  It was posted on 
Slashdot.org today.

http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

If you do any experimenting with this here's a usefull hint:

Use the '-static -g' gcc options to give you an executable with no 
external libraries needed.

objdump is usefull for dissasembling programs.. check out the man page.

Later.

-- 
Neal Richter
Ph.D. Candidate, Computer Science, Montana State University

The Linux Documentation Project (tldp)

Follow this link to The Linux Documentation Project (thanks Valerie).

Compiling the Kernel

Try this one for compiling the kernel (thanks Valerie).  For other links (possibly duplicates) see Neal's Links and Hints below.

Booting Linux

Learning about booting Linux (thanks Valerie) can be done here. For other links (possibly duplicates) see Neal's Links and Hints below.

Another description of the boot process for Linux (thanks Neal) http://www.pcguide.com/ref/mbsys/bios/boot_Sequence.htm

Here's an overview of the FreeBSD kernel boot process for comparison (thanks Neal):

     http://www.freebsd.org/doc/en/books/developers-handbook/boot.html

Here's the Linux system start-up call overview from the KernelAnalysis-HOWTO:

     http://www.tldp.org/HOWTO/KernelAnalysis-HOWTO-4.html

First Processes in Linux

This comment is from Ming.

Hi, here are some findings I got while grepping linux source, for sharing:

There are three types of process/thread/task/or_whatever in linux 2.4.

1. the idle thread (or process 0)

init/main.c: start_kernel => rest_init => 
	arch/i386/kernel/process.c: cpu_idle

2. the user processes (/etc/init the grand-daddy and his offsprings)

init/main.c: start_kernel => rest_init => kernel_thread => init => execve
	=> /etc/init => fork/exec

3.1. kernel daemon threads like kswapd, bdflush... ("ps -A | head")

init/main.c: start_kernel => rest_init => kernel_thread => init =>
	do_basic_setup => do_initcalls

do_initcalls will then invoke the module_init function for each kernel 
module that implements a daemon thread. For example, kswapd is started 
like this:

do_initcalls => mm/vmscan.c: kswapd_init => kernel_thread => kswapd

If you grep /boot/System.map, you will find the entry 
__initcall_kswapd_init, which is connection between do_initcalls and 
kswapd_init.

3.2. other kernel threads, tasklets... started by dynamically loaded 
kernel modules or kernel daemon threads or kernel itself

Mostly through arch/i386/kernel/process.c: kernel_thread.

 

General Linux Books

Learning about Linux in general can be done here (thanks Valerie).

Neal's Links

Neal Richter in our class has put together a nice set of resources which he is sharing with us.  His links can be found at

Unix Links

Journals Links

Especially to note at this part of the course are two articles in PDF form on the Linux boot process which you will find on the Unix Links link are

Kernel Analysis HOWTO

Linux Kernel 2.4 Internals

Processes/Threads in Linux (Ming)

Hi, here are some findings I got while grepping linux source, for sharing:

There are three types of process/thread/task/or_whatever in linux 2.4.

1. the idle thread (or process 0)

init/main.c: start_kernel => rest_init => 
	arch/i386/kernel/process.c: cpu_idle

2. the user processes (/etc/init the grand-daddy and his offsprings)

init/main.c: start_kernel => rest_init => kernel_thread => init => execve
	=> /etc/init => fork/exec

3.1. kernel daemon threads like kswapd, bdflush... ("ps -A | head")

init/main.c: start_kernel => rest_init => kernel_thread => init =>
	do_basic_setup => do_initcalls

do_initcalls will then invoke the module_init function for each kernel 
module that implements a daemon thread. For example, kswapd is started 
like this:

do_initcalls => mm/vmscan.c: kswapd_init => kernel_thread => kswapd

If you grep /boot/System.map, you will find the entry 
__initcall_kswapd_init, which is connection between do_initcalls and 
kswapd_init.

3.2. other kernel threads, tasklets... started by dynamically loaded 
kernel modules or kernel daemon threads or kernel itself

Mostly through arch/i386/kernel/process.c: kernel_thread.


Cheers,
Ming