bootloader传递给内核的参数
在bootloader启动kernel之前会设置ARM CPU的r0,r1,r2,r9寄存器:
未使用device tree的2.6版本中,只需要将:
r0=0;
r1=machine_id;
r2=atags_address;
使用device tree之后,就稍微复杂一些,设置如下:
r0=cp#15 control register;
r1=machine ID;
r2=atags/dtb pointer;
r9=processor ID;
在arm/arm/kernel/head-common.S中,汇编代码会将这几个寄存器的值保存到几个变量中。
/*
* The following fragment of code is executed with the MMU on in MMU mode,
* and uses absolute addresses; this is not position independent.
*
* r0 = cp#15 control register
* r1 = machine ID
* r2 = atags/dtb pointer
* r9 &#