
Build a Secure Bare-Metal Runtime in Rust: From Firmware to User Space
This course plugs the gap between the pure bare metal embedded development world and highly abstracted OS based embedded development. In pure embedded development the user application and critical code section all live in same privilege domain and same memory domain. In OS based embedded development, the hardware is highly abstracted with 3 privilege levels (machine, supervisor & user) and with memory domain seperation with MMU. In this course, we learn about a in-between approach with 2 privilege levels namely user and machine privilege modes and achieve memory seperation with physical memory protection.
Explore the boundary between traditional bare-metal firmware and operating systems by building a secure, privilege-separated runtime for RISC-V microcontrollers.
Starting from bare-metal Rust, you'll develop machine-mode firmware and independent user-mode applications, configure physical memory protection (PMP), implement trap handling, and design a custom system-call interface that allows unprivileged applications to request privileged firmware services.
This hands-on project introduces fundamental operating-system concepts without requiring a full operating system. You'll learn how to establish memory boundaries, separate application execution from privileged firmware, and build the foundations of a protected user-space environment.
Recommended hardware: SiFive HiFive1 Rev B (FE310-G002). Please watch the lectures in order, if you skip, it would be hard to catchup and understand.