arm linux演艺(二)
2013-03-21
xiangye
标签: ARM Linux

长篇连载--arm linux演艺---第二回

--------------------------------------------------------------------------------

上回书说到flashloader把bootloader load到0x0AFE0100, 然回跳了过去,

其实0x0AFE0100 就是烧在flash 0x0C000100中的真正的bootloader:

bootloader 有几个文件组成,先是START.s,也是唯一的一个汇编程序,其余的都是C写成的,START.s主要初始化堆栈:

_start:

ldr r1,=StackInit

ldr sp,[r1]

b main

//此处我们跳到了C代码的main函数,当C代码执行完后,还要调用

//下面的JumpToKernel0x跳到LINXU kernel运行

.equ StackInitValue, __end_data+0x1000 // 4K __end_data在连结脚本中指定

StackInit:

.long StackInitValue

.global JumpToKernel

JumpToKernel:

// jump to the copy code (get the arguments right)

mov pc, r0

.global JumpToKernel0x

// r0 = jump address

// r1-r4 = arguments to use (these get shifted)

JumpToKernel0x:

// jump to the copy code (get the arguments right)

mov r8, r0

mov r0, r1

mov r1, r2

mov r2, r3

mov r3, r4

mov pc, r8

.section ".data.boot"

.section ".bss.boot"

欲知bootloader中的c代码如何运行,请看Arm linux下集

可能会用到的工具/仪表
本站简介 | 意见建议 | 免责声明 | 版权声明 | 联系我们
CopyRight@2024-2039 嵌入式资源网
蜀ICP备2021025729号