慢慢欣赏arm64内核启动1 primary_entry之保存启动参数

启动内核

我们反汇编内核后,然后看一下内核起始的地方

$ 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值