|
|
Web Links
Listed here are a number of links to web resources that should be helpful. ElfHey, 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)
Compiling the Kernel
Booting Linux
First Processes in Linux
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
Neal's Links
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
|
|
|