by daveguy · 4mo ago · 0 comments
I was extremely surprised by how much functionality is packed into "core", and runs without an OS when using freestanding rust. Even stuff that requires an allocator can run provided you provide your own heap!
A cool example of this was implementing fmt::Write for a memory mapped uart console thing. Then implementing a kprintln! macro that supports all of the formatting machinery that you are use to. This worked without even a heap available.
Compiled Rust code that relies on syscalls will not function on a “bare metal” microcontroller.
Yes, I should have said binary opcodes instead of assembly. I just assumed anyone discussing embedded systems would know they are practically interchangeable.