2.2 opensbi: riscv: opensbi源码解析

文章目录

    • 2.6 清理bss和设置栈
    • 2.7 保存fw_dynamic_info到sbi的变量中
      • 2.7.1 fw_save_info函数
    • 2.8 读取hart数量
      • 2.8.1 fw_platform_init()函数
    • 2.9 初始化sbi_scatch结构体
    • 2.10 重定位fdt
    • 2.11调用c的最后准备:_start_warm()

2.6 清理bss和设置栈

  1. 设置寄存器为0,除了ra, a0, a1 和 a2
  2. 清零bss段
  3. 设置异常向量表处理函数为_start_hang
  4. 设置临时栈道_fw_end(opensbi代码结束地址)后8KB处
	/* At this point we are running from link address */

	/* Reset all registers for boot HART */
	/*1. 设置寄存器为0*/
	li	ra, 

你可能感兴趣的:(risc-v)