rust-raspberrypi-OS-tutorials/02_runtime_init
2020-03-28 13:27:23 +01:00
..
.vscode Switch to rust-analyzer 2020-03-10 23:40:04 +01:00
src Refactor tutorial 02 2020-03-28 13:27:23 +01:00
Cargo.lock For educational purposes, use own zero_bss(). 2020-01-04 18:15:43 +01:00
Cargo.toml For educational purposes, use own zero_bss(). 2020-01-04 18:15:43 +01:00
kernel Refactor tutorial 02 2020-03-28 13:27:23 +01:00
kernel8.img Refactor tutorial 02 2020-03-28 13:27:23 +01:00
Makefile Refactor tutorial 02 2020-03-28 13:27:23 +01:00
README.md Refactor tutorial 02 2020-03-28 13:27:23 +01:00

Tutorial 02 - Runtime Init

tl;dr

We extend cpu.S to call into Rust code for the first time. There,we zero the bss section before execution is halted with a call to panic(). Check out make qemu again to see the additional code run.

Notable additions

  • More sections in linker script:
    • .rodata, .data
    • .bss
  • _start():
    • Halt core if core != core0.
    • core0 jumps to the runtime_init() Rust function.
  • runtime_init() in runtime_init.rs
    • Zeros the .bss section.
    • Calls kernel_init(), which calls panic!(), which eventually halts core0 as well.

Diff to previous