Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Beyond Bare Metal: A RISC-V User-Space Runtime in Rust
New
3 students

Beyond Bare Metal: A RISC-V User-Space Runtime in Rust

Write your first user mode application on RISC-V target with embedded rust.
Last updated 11/2026
English

What you'll learn

  • Understand why the application runs in U-mode while the firmware retains M-mode privileges
  • Understand why ecall causes a trap instead of behaving like a normal Rust function call
  • How to pass a service identifier, function identifier, and argument through registers
  • Understand complete execution flow from user mode request through the trap handler and into the UART console and return back to user mode application

Course content

6 sections • 19 lectures • 2h 14m total length
  • Introduction5:12
  • Project Architecture8:08

Requirements

  • Prerequisites: basic Rust, familiarity with Cargo, and basic computer architecture. Prior assembly experience would help.

Description

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.

Who this course is for:

  • Embedded Rust developers who already understand basic no_std programming. Firmware engineers who want to understand RISC-V privilege modes and trap handling. - Developers interested in operating-system concepts without starting with a full OS.