explaingit

rust-embedded/rust-raspberrypi-os-tutorials

Analysis updated 2026-06-24

14,654RustAudience · developerComplexity · 5/5LicenseSetup · hard

TLDR

Step-by-step tutorial series for writing a bare-metal OS kernel in Rust that boots on Raspberry Pi 3 and 4, or in QEMU emulation.

Mindmap

mindmap
  root((rust-raspberrypi-OS-tutorials))
    Inputs
      Rust toolchain
      Docker container
      Raspberry Pi 3 or 4
      USB serial cable
    Outputs
      Bootable kernel binaries
      UART serial console output
      Documented source code
    Use Cases
      Learn embedded OS dev
      Study ARMv8-A boot flow
      Bare-metal Rust practice
    Tech Stack
      Rust
      ARMv8-A
      QEMU
      Docker
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Follow the lessons to build a working ARM64 kernel from scratch in Rust

USE CASE 2

Study how to set up MMU, exceptions, and UART drivers on Raspberry Pi

USE CASE 3

Fork the modular code as a starting point for porting to RISC-V or other boards

USE CASE 4

Run the kernel binaries in QEMU to learn embedded debugging without hardware

What is it built with?

RustARMv8-AQEMUDockerGDBOpenOCD

How does it compare?

rust-embedded/rust-raspberrypi-os-tutorialslgug2z/komorebianalysis-tools-dev/static-analysis
Stars14,65414,55314,542
LanguageRustRustRust
Last pushed2026-05-18
MaintenanceMaintained
Setup difficultyhardmoderateeasy
Complexity5/54/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Real hardware runs need a CP2102 USB-to-serial cable plus GPIO wiring, macOS support is experimental and requires extra Ruby gems.

Dual licensed under MIT or Apache 2.0, so you can use the code freely in personal or commercial work as long as you keep the original notices.

In plain English

This repository is a tutorial series that walks you through writing your own operating system kernel in the Rust programming language, running on a Raspberry Pi. It is aimed at hobby OS developers who are new to ARM's 64 bit ARMv8-A chip architecture, which is what powers modern Raspberry Pi boards. The README describes it as a step by step guided tour that builds a monolithic kernel from scratch, covering tasks like writing text to a serial console, setting up virtual memory, and handling hardware exceptions, while using Rust's safety and speed features along the way. The author is Andre Richter. The tutorials are organised so each lesson contains its own standalone, bootable kernel binary, and each new tutorial builds on the previous one. Every tutorial folder has a short tl,dr section that lists what changed compared to the last lesson, plus a code diff so you can see the additions easily. Some lessons also include longer written explanations. The first five lessons only make sense to run inside QEMU, which is an emulator. From lesson five onward the code can be loaded onto a real Raspberry Pi 3 or Raspberry Pi 4, with output coming out over a UART serial connection. The code is structured so that porting to other chips or boards should be possible, and the author mentions wanting someone to try a RISC-V port. For setup, the README points you to install Docker, set up the Rust toolchain via rustup, and install two helper crates called cargo-binutils and rustfilt. Linux is the primary supported host, with macOS treated as experimental and needing some extra Ruby gems. Visual Studio Code with the Rust Analyzer extension is recommended for editing. A make doc command is included in each tutorial so you can browse the well-commented source code locally. The README explains the project leans on Docker to avoid the usual pain of installing the right versions of tools like QEMU, OpenOCD, and GDB. A container with everything preinstalled is pulled in when needed. For real hardware use the README recommends a USB to serial cable, ideally based on the CP2102 chip, wired to specific GPIO pins on the Pi. Starting with tutorial 6 a chainloader makes it easy to push new kernels over UART without swapping the SD card each time. The series originally started as a fork of Zoltan Baldaszti's bare metal RPi3 tutorials in C, and it has community translations into Chinese and Spanish.

Copy-paste prompts

Prompt 1
Walk me through what tutorial 5 in rust-raspberrypi-OS-tutorials changes versus tutorial 4, file by file
Prompt 2
Show me how the chainloader from tutorial 6 receives a new kernel over UART and jumps to it
Prompt 3
Help me port the tutorial 10 virtual memory setup from AArch64 to RISC-V, listing the equivalent registers
Prompt 4
Set up a Docker-based dev loop so I can build and run any tutorial chapter with one make command
Prompt 5
Explain how Rust's no_std and inline assembly are used in the early boot code of this repo

Frequently asked questions

What is rust-raspberrypi-os-tutorials?

Step-by-step tutorial series for writing a bare-metal OS kernel in Rust that boots on Raspberry Pi 3 and 4, or in QEMU emulation.

What language is rust-raspberrypi-os-tutorials written in?

Mainly Rust. The stack also includes Rust, ARMv8-A, QEMU.

What license does rust-raspberrypi-os-tutorials use?

Dual licensed under MIT or Apache 2.0, so you can use the code freely in personal or commercial work as long as you keep the original notices.

How hard is rust-raspberrypi-os-tutorials to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is rust-raspberrypi-os-tutorials for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.