You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

903 B

教程 02 - 执行初始化

tl;dr

我们拓展了boot.S在第一次启动的时候调用Rust代码。在Rust的代码中先清零了bss section然后通过调用panic()挂起CPU。再次运行make qemu看看新增加的代码是怎么运行的。

值得注意的变化

  • 链接脚本linker script中有了更多的section。
    • .rodata, .data
    • .bss
  • _start():
    • 当核心不是core0第0号核心的时候挂起该CPU核心。
    • core0会调用Rust的函数runtime_init()
  • runtime_init.rs内的runtime_init()
    • 清零了.bss section.
    • 它调用了kernel_init(), 这个函数又调用了panic!(), panic函数最终把core0和其他核心一样挂起了。

相比之前的变化diff

请检查英文版本,这是最新的。