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.
Andre Richter e8d787f627
Refactor tutorial 02
4 years ago
..
.vscode Switch to rust-analyzer 4 years ago
src Refactor tutorial 02 4 years ago
Cargo.lock For educational purposes, use own zero_bss(). 4 years ago
Cargo.toml For educational purposes, use own zero_bss(). 4 years ago
Makefile Refactor tutorial 02 4 years ago
README.md Refactor tutorial 02 4 years ago
kernel Refactor tutorial 02 4 years ago
kernel8.img Refactor tutorial 02 4 years ago

README.md

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