redshirt
redshirt copied to clipboard
Rewrite the ARM entry points to be pure assembly
https://github.com/tomaka/redshirt/blob/d047867200681f38805fae9779cc33096c9006a4/kernel/standalone/src/arch/arm.rs#L52-L137
Since they are #[naked] functions, they can't use Rust code.
The BSS needs to be cleared, but since the BSS includes the stack, this clearing can only be done before jumping to the Rust code, and thus needs to be in assembly.
I personally have a lot of trouble 1) navigating the ARM assembly documentation 2) putting the start and end offsets into registers. For 2), you'd normally use the adrl pseudo-opcode, but LLVM doesn't support it.