[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5444":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":16,"starSnapshotCount":16,"syncStatus":44,"lastSyncTime":45,"discoverSource":46},5444,"rust-raspberrypi-OS-tutorials","rust-embedded\u002Frust-raspberrypi-OS-tutorials","rust-embedded",":books: Learn to write an embedded OS in Rust :crab:","",null,"Rust",14679,874,237,16,0,9,34,3,43.83,"Apache License 2.0",false,"master",[25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"aarch64","arm64","armv8","bare-metal","embedded-rust","kernel","operating-system","os","raspberry","raspberry-pi","raspberry-pi-3","raspberry-pi-4","rpi3","rpi4","rust","tutorial","2026-06-12 02:01:10","# Operating System development tutorials in Rust on the Raspberry Pi\n\n![](https:\u002F\u002Fgithub.com\u002Frust-embedded\u002Frust-raspberrypi-OS-tutorials\u002Fworkflows\u002FBSP-RPi3\u002Fbadge.svg) ![](https:\u002F\u002Fgithub.com\u002Frust-embedded\u002Frust-raspberrypi-OS-tutorials\u002Fworkflows\u002FBSP-RPi4\u002Fbadge.svg) ![](https:\u002F\u002Fgithub.com\u002Frust-embedded\u002Frust-raspberrypi-OS-tutorials\u002Fworkflows\u002FUnit-Tests\u002Fbadge.svg) ![](https:\u002F\u002Fgithub.com\u002Frust-embedded\u002Frust-raspberrypi-OS-tutorials\u002Fworkflows\u002FIntegration-Tests\u002Fbadge.svg) ![](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT%20OR%20Apache--2.0-blue)\n\n\u003Cbr\u002F>\n\n\u003Cimg src=\"doc\u002Fheader.jpg\" height=\"372\"> \u003Cimg src=\"doc\u002Fminipush_demo_frontpage.gif\" height=\"372\">\n\n## ℹ️ Introduction\n\nThis is a tutorial series for hobby OS developers who are new to ARM's 64 bit [ARMv8-A\narchitecture]. The tutorials will give a guided, step-by-step tour of how to write a [monolithic]\nOperating System `kernel` for an `embedded system` from scratch. They cover implementation of common\nOperating Systems tasks, like writing to the serial console, setting up virtual memory and handling\nHW exceptions. All while leveraging `Rust`'s unique features to provide for safety and speed.\n\nHave fun!\n\n_Best regards,\u003Cbr>Andre ([@andre-richter])_\n\nP.S.: For other languages, please look out for alternative README files. For example,\n[`README.CN.md`](README.CN.md) or [`README.ES.md`](README.ES.md). Many thanks to our\n[translators](#translations-of-this-repository) 🙌.\n\n[ARMv8-A architecture]: https:\u002F\u002Fdeveloper.arm.com\u002Fproducts\u002Farchitecture\u002Fcpu-architecture\u002Fa-profile\u002Fdocs\n[monolithic]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMonolithic_kernel\n[@andre-richter]: https:\u002F\u002Fgithub.com\u002Fandre-richter\n\n## 📑 Organization\n\n- Each tutorial contains a stand-alone, bootable `kernel` binary.\n- Each new tutorial extends the previous one.\n- Each tutorial `README` will have a short `tl;dr` section giving a brief overview of the additions,\n  and show the source code `diff` to the previous tutorial, so that you can conveniently inspect the\n  changes\u002Fadditions.\n    - Some tutorials have a full-fledged, detailed text in addition to the `tl;dr` section. The\n      long-term plan is that all tutorials get a full text, but for now this is exclusive to\n      tutorials where I think that `tl;dr` and `diff` are not enough to get the idea.\n- The code written in these tutorials supports and runs on the **Raspberry Pi 3** and the\n  **Raspberry Pi 4**.\n  - Tutorials 1 till 5 are groundwork code which only makes sense to run in `QEMU`.\n  - Starting with [tutorial 5](05_drivers_gpio_uart), you can load and run the kernel on the real\n    Raspberrys and observe output over `UART`.\n- Although the Raspberry Pi 3 and 4 are the main target boards, the code is written in a modular\n  fashion which allows for easy porting to other CPU architectures and\u002For boards.\n  - I would really love if someone takes a shot at a **RISC-V** implementation!\n- For editing, I recommend [Visual Studio Code] with [Rust Analyzer].\n- In addition to the tutorial text, also check out the `make doc` command in each tutorial. It lets\n  you browse the extensively documented code in a convenient way.\n\n### Output of `make doc`\n\n![make doc](doc\u002Fmake_doc.png)\n\n[Visual Studio Code]: https:\u002F\u002Fcode.visualstudio.com\n[Rust Analyzer]: https:\u002F\u002Frust-analyzer.github.io\n\n## 🛠 System Requirements\n\nThe tutorials are primarily targeted at **Linux**-based distributions. Most stuff will also work on **macOS**, but this is only _experimental_.\n\n### 🚀 The tl;dr Version\n\n1. [Install Docker Engine][install_docker].\n1. (**Linux only**) Ensure your user account is in the [docker group].\n1. Prepare the `Rust` toolchain. Most of it will be handled on first use through the\n   [rust-toolchain.toml](rust-toolchain.toml) file. What's left for us to do is:\n   1. If you already have a version of Rust installed:\n      ```bash\n      cargo install cargo-binutils rustfilt\n      ```\n\n   1. If you need to install Rust from scratch:\n      ```bash\n      curl --proto '=https' --tlsv1.2 -sSf https:\u002F\u002Fsh.rustup.rs | sh\n\n      source $HOME\u002F.cargo\u002Fenv\n      cargo install cargo-binutils rustfilt\n      ```\n\n1. In case you use `Visual Studio Code`, I strongly recommend installing the [Rust Analyzer extension].\n1. (**macOS only**) Install a few `Ruby` gems.\n\n  This was last tested by the author with Ruby version `3.0.2` on `macOS Monterey`. If you are using\n  `rbenv`, the respective `.ruby-version` file is already in place. If you never heard of `rbenv`,\n  try using [this little guide](https:\u002F\u002Fstackoverflow.com\u002Fa\u002F68118750).\n\n   Run this in the repository root folder:\n\n   ```bash\n   bundle config set --local path '.vendor\u002Fbundle'\n   bundle config set --local without 'development'\n   bundle install\n   ```\n\n[docker group]: https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Finstall\u002Flinux-postinstall\u002F\n[Rust Analyzer extension]: https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=matklad.rust-analyzer\n\n### 🧰 More Details: Eliminating Toolchain Hassle\n\nThis series tries to put a strong focus on user friendliness. Therefore, efforts were made to\neliminate the biggest painpoint in embedded development as much as possible: `Toolchain hassle`.\n\nRust itself is already helping a lot in that regard, because it has built-in support for\ncross-compilation. All that we need for cross-compiling from an `x86` host to the Raspberry Pi's\n`AArch64` architecture will be automatically installed by `rustup`. However, besides the Rust\ncompiler, we will use some more tools. Among others:\n\n- `QEMU` to emulate our kernel on the host system.\n- A self-made tool called `Minipush` to load a kernel onto the Raspberry Pi on-demand over `UART`.\n- `OpenOCD` and `GDB` for debugging on the target.\n\nThere is a lot that can go wrong while installing and\u002For compiling the correct version of each tool\non your host machine. For example, your distribution might not provide the latest version that is\nneeded. Or you are missing some hard-to-get dependencies for the compilation of one of these tools.\n\nThis is why we will make use of [Docker][install_docker] whenever possible. We are providing an\naccompanying container that has all the needed tools or dependencies pre-installed, and it gets\npulled in automagically once it is needed. If you want to know more about Docker and peek at the\nprovided container, please refer to the repository's [docker](docker) folder.\n\n[install_docker]: https:\u002F\u002Fdocs.docker.com\u002Fengine\u002Finstall\u002F#server\n\n## 📟 USB Serial Output\n\nSince the kernel developed in the tutorials runs on the real hardware, it is highly recommended to\nget a USB serial cable to get the full experience.\n\n- You can find USB-to-serial cables that should work right away at [\\[1\\]] [\\[2\\]], but many others\n  will work too. Ideally, your cable is based on the `CP2102` chip.\n- You connect it to `GND` and GPIO pins `14\u002F15` as shown below.\n- [Tutorial 5](05_drivers_gpio_uart) is the first where you can use it. Check it out for\n  instructions on how to prepare the SD card to boot your self-made kernel from it.\n- Starting with [tutorial 6](06_uart_chainloader), booting kernels on your Raspberry is getting\n  _really_ comfortable. In this tutorial, a so-called `chainloader` is developed, which will be the\n  last file you need to manually copy on the SD card for a while. It will enable you to load the\n  tutorial kernels during boot on demand over `UART`.\n\n![UART wiring diagram](doc\u002Fwiring.png)\n\n[\\[1\\]]: https:\u002F\u002Fwww.amazon.de\u002Fdp\u002FB0757FQ5CX\u002Fref=cm_sw_r_tw_dp_U_x_ozGRDbVTJAG4Q\n[\\[2\\]]: https:\u002F\u002Fwww.adafruit.com\u002Fproduct\u002F954\n\n## 🙌 Acknowledgements\n\nThe original version of the tutorials started out as a fork of [Zoltan\nBaldaszti](https:\u002F\u002Fgithub.com\u002Fbztsrc)'s awesome [tutorials on bare metal programming on\nRPi3](https:\u002F\u002Fgithub.com\u002Fbztsrc\u002Fraspi3-tutorial) in `C`. Thanks for giving me a head start!\n\n### Translations of this repository\n\n - **Chinese**\n   - [@colachg] and [@readlnh].\n   - Need updating.\n - **Spanish**\n   -  [@zanezhub].\n   -  In the future there'll be tutorials translated to spanish.\n\n[@colachg]: https:\u002F\u002Fgithub.com\u002Fcolachg\n[@readlnh]: https:\u002F\u002Fgithub.com\u002Freadlnh\n[@zanezhub]: https:\u002F\u002Fgithub.com\u002Fzanezhub\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or \u003Chttps:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0>)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or \u003Chttps:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT>)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the\nwork by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n","该项目是一个基于Rust语言的教程系列，旨在指导开发者从零开始为树莓派3和4编写一个嵌入式操作系统内核。核心功能包括实现常见的操作系统任务，如写入串行控制台、设置虚拟内存以及处理硬件异常等，同时利用Rust的安全性和性能优势。该教程适合对ARM 64位架构感兴趣的业余操作系统开发者，特别是那些希望深入了解底层系统编程或想要学习如何使用现代语言进行裸机开发的人士。代码以模块化方式编写，便于移植到其他CPU架构或板卡上。",2,"2026-06-11 03:03:22","top_language"]