📚 Learn to write an embedded OS in Rust 🦀
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Andre Richter 8d6c58ad57
Add code for tutorial 09
5 years ago
.githooks Initial preparations for rewrite 5 years ago
01_wait_forever Update README.md 5 years ago
02_runtime_init Fix diff script 5 years ago
03_hacky_hello_world Fix diff script 5 years ago
04_zero_overhead_abstraction Fix diff script 5 years ago
05_safe_globals Fix diff script 5 years ago
06_drivers_gpio_uart Fix diff script 5 years ago
07_uart_chainloader Fix diff script 5 years ago
08_timestamps Fix diff script 5 years ago
09_hw_debug_JTAG Add code for tutorial 09 5 years ago
X1_JTAG_boot Add code for tutorial 09 5 years ago
doc Add code for tutorial 09 5 years ago
docker Add code for tutorial 09 5 years ago
utils Fix diff script 5 years ago
.gitignore Add code for tutorial 09 5 years ago
.rubocop.yml Adapt tooling settings 5 years ago
.rustfmt.toml Adapt tooling settings 5 years ago
LICENSE Initial preparations for rewrite 5 years ago
README.md Typo 5 years ago
contributor_setup.sh Add a pre-commit hook 5 years ago

README.md

Operating System development tutorials in Rust on the Raspberry Pi

Notice

This is a work-in-progress rewrite, started on September 2019. I will first add code and minimal READMEs, and later write accompanying full-fledged tutorial text.

  • The code written in these tutorials supports and runs on the Raspberry Pi 3 and the Raspberry Pi 4.
    • Tutorials 1 till 5 are groundwork code which only makes sense to run on QEMU.
    • Starting with tutorial 6, you can load and run the kernel on Raspberrys and observe output over UART.
  • For practical purposes, the kernel will be a classic monolith.
  • For editing, I recommend Visual Studio Code with the Rust Language Server extension.
  • Check out the make doc command to browse the code with HTML goodness.
  • Note that the branch is subject to frequent force pushing. If updates happened since you last visited, make sure to clone a clean copy to be safe.

Cheers, Andre

Prerequisites

Before you can start, you'll need a suitable Rust toolchain.

curl https://sh.rustup.rs -sSf  \
    |                           \
    sh -s --                    \
    --default-toolchain nightly \
    --component rust-src llvm-tools-preview clippy rustfmt rls rust-analysis

cargo install cargo-xbuild cargo-binutils

USB Serial

It is highly recommended to get a USB serial debug cable. It also powers the Raspberry once you connect it, so you don't need extra power over the dedicated power-USB. I use a bunch of these.

You connect it to the GPIO pins 14/15 as shown beyond.

Tutorial 6 is the first where you can use it. Go to the README there for instructions on how to prepare the SD card to run your self-made kernels from it.

UART wiring diagram

License

Licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT).