Embedded System – Linux study for ARM (2)
The linux for arm kernel startup code is located in arch/arm/kernel/head.S and in the comment we know the system shold be
- The startup is normally called in decompressor pcode
- The requirement are
- MMU = off
- D-Cache = off
- I-Cache = dont care
- R0 = 0 , R1 = machine nr , R2= atags or dtb pointer
- Most of the startup code is position independent, so if you link the kernel at 0xc00008000, you call this startup code at __pa(0xc0008000)
In latest linux kernel, some code is split to head-common.S, and we could find “b start_kernel” (the main program write in C to initialize kernel) here.