4.13.2009

How Linux kernel Init

要了解kernel 如何init
先了解kernel image 的架構


vmlinux 是kernel 本身再加了一些符號什麼的
然後把那些符號拿掉就成了image 的binary
之後用gzip 壓成piggy.gz
然後用asmbaly build 成piggy.o


*bootstrap loader and bootloader的不同
bootloader 只負責POWER ON

*bootstrap loader(second-stage loader),head.o @bootstrap loader
1.creat the proper environment to decompress,
2.relocate the kernel,
3.pass control to head.o@kernel




*head.o @kernel

1.Checks for valid processor and architecture
2.Creates initial page table entries
3.Enables the processor's memory management unit (MMU)
4.Establishes limited error detection and reporting
5.Jumps to the start of the kernel proper, main.c

在這個時候只有有限的memory maping.. 所以如果想在這加個firmwave 去down load到特定的device,是會crash的
要init driver 就透過device driver model

*start_kernel() @ .../init/main.c

2 comments:

Anonymous said...

It seems to me that your diagram is copied from the book "Embedded Linux Primer". Please respect the copyright

Arik said...

thanks for reminder..