rust-embedded/rust-raspberrypi-OS-tutorials

Pure rust chainboot

berkus opened this issue · 1 comments

Was trying to find through which medium to contact @andre-richter, but hey, this is as good as any.

Some fun: pure Rust chain bootloader for Raspberry Pi

:)

Nice! I actually went the exact different route and returned to doing basic init in assembly after reading rust-embedded/cortex-m-rt#300.

This decision was later reinforced when I realized that you cannot rely on the compiler to not reorder register manipulations done through cortex-a, aka tock-registers, with other operations. Unfortunately I don’t remember exactly where I observed it in a problematic situation, and more unfortunately, I never followed through documenting it.

Might have been a situation where I wanted to re-set the stack pointer, but function prologue operations always came in first. But naked functions might have helped, so I’m not sure if it was this example.

All in all, I personally feel more safe having bss and stack prepared in assembly, and thus having the basics of the abstract machine sound when we start with Rust.

In your code's comments I saw the reference to rust-embedded/cortex-m-rt#300 as well, but haven’t yet checked the other resources you mentioned regarding this discussion.