Embedded Linux: Kernel Make (Compressed With Boot)
Embedded Linux: Kernel Make (Compressed With Boot)
kernel
in $(TOPDIR)
% make -- $(TOPDIR) linux ( vmlinux) . % file linux ELF 32-bit LSB executable, Advanced RISC Machines ARM, version 1, statically linked, not stripped
kernel
: File sequence
arch/armnommu/kernel init/
. . . .
http://network.hanbat.ac.kr Embedded Linux 2
arch/arm/kernel/head-armv.S
Set
bl __lookup_processor_type
r0 = 0, r1= unique architecture number, MMU = off, I-cache = on/off, D-cache = off mode to supervisor, all IRQs to disable
http://network.hanbat.ac.kr
Embedded Linux
Refer
http://www.linuxdoc.org/HOWTO/Linux-Init-HOWTO-5.html setup_arch()
main.c/start_kernel()
trap_init(), init_IRQ() /* initialize IRQ handler */ sched_init() softirq_init() time_init(); /* initialize timer */ console_init() init_modules() kmem_cache_init(), mem_init(), mount initrd (maybe) cpu_idle();
Embedded Linux
http://network.hanbat.ac.kr
kernel
(not completed)
* (.text.init)
x16
_stext, __init_begin __proc_info_begin __proc_info_end, __arch_info_begin __arch_info_end __setup_start __setup_end, __initcall_start _text
* (.proc .info) * (.arc h.info) * (.data.init) * (.setup.init) * (.initc all.init) * (.text) ...
.init
x 4096
.text
http://network.hanbat.ac.kr
Embedded Linux
boot/compressed/vmlinux
boot/zImage
y objcop
zImage
. . .
y objcop gzip, ld
http://network.hanbat.ac.kr
Embedded Linux
$(TOPDIR)/arch/armnommu/boot/compressed/vmlinux
*(.start) *(.text) *(.fixup) *(.gnu.warning) *(.rodata) *(.rodata.*) *(.glue_7) *(.glue_7t) piggy.o data bss stack *(.data) *(.bss) *(.stack) LOAD_ADDR, _load_addr, TEXT_START, _text, _start
text
http://network.hanbat.ac.kr
Embedded Linux
Flash Image
...boot/bootp/bootp (Flash )
init.o zImage
ld
kernel.o initrd.o
ld
initrd
Embedded Linux
http://network.hanbat.ac.kr
kernel.o
. . .
http://network.hanbat.ac.kr
Embedded Linux
RAM
, in ...boot /c ompressed/
kernel.o
(1)
. . .
(1) power-on boot block pc flash init.o . (pc r0=0, r1="unique architecture #, MMU off, D-cache off . head-armv.S .)
boot block
http://network.hanbat.ac.kr
Embedded Linux
10
(2 )
boot block
http://network.hanbat.ac.kr
initrd.o ,
Embedded Linux
11
, in . ..boot/c ompressed/
. . .
(3)
boot block
http://network.hanbat.ac.kr
kernel
Embedded Linux
12