启动内核
我们反汇编内核后,然后看一下内核起始的地方
$ aarch64-none-linux-gnu-objdump -d vmlinux.o > vmlinux.txt
$ head vmlinux.txt
vmlinux: file format elf64-littleaarch64
Disassembly of section .head.text:
ffff800010000000 <_text>:
ffff800010000000: 91005a4d add x13, x18, #0x16
ffff800010000004: 144bbfff b ffff8000112f0000 <primary_entry>
...
根据上一章节,bootloader将控制权交给内核,内核从__HEAD段的开头执行。该段的起始位置是_head
代码分析
_head
/*
* Kernel startup entry point.
* ---------------------------
*
* The requirements are:
* MMU = off, D-cache = off, I-cache = on or off,
* x0 = physical address to the FDT blob.
*
* This code is mostly position independent so you call this at
* __pa(PAGE_OFFSET).
*
* Note that the callee-saved registers are used for storing variables
* that are useful before the MMU is enabled. The allocations are described
* in the entry routines.
*/
__HEAD
_head:
/*
* DO NOT MODIFY. Imag

最低0.47元/天 解锁文章
2327

被折叠的 条评论
为什么被折叠?



