📚 Learn to write an embedded OS in Rust 🦀
Go to file
2019-10-27 23:09:23 +01:00
.0A_power Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.0B_hw_debug_JTAG Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.0C_exception_levels Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.0D_virtual_memory Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.0E_cache_performance Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.0F_globals_synchronization_println Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.01_bareminimum Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.02_multicore_rust Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.03_uart1 Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.04_mailboxes Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.05_uart0 Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.06_raspbootin64 Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.07_abstraction Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.08_random Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.09_delays Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.10_DMA_memory Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.11_exceptions_groundwork Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.githooks Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.X1_JTAG_boot Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
doc Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
docker Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
utils Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
.gitignore Ignore cargo built files 2019-03-19 23:38:04 +01:00
contributor_setup.sh Add a pre-commit hook 2019-01-12 21:55:28 +01:00
LICENSE Initial preparations for rewrite 2019-10-27 23:09:23 +01:00
README.md Initial preparations for rewrite 2019-10-27 23:09:23 +01:00

Bare-metal and Operating System development tutorials in Rust on the Raspberry Pi 3

Notice

This is a work-in-progress rewrite started on September 2019. I will first add code, and later write accompanying prose.

The rewrite also supports both, the Raspberry Pi 3 and the Raspberry Pi 4!

Cheers, Andre

Prerequisites

Before you can start, you'll need a suitable Rust toolchain. Please browse to the rustup components history and note the date of the most recent build that shows clippy as present.

Then, proceed to install this nightly using your noted date:

curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-YOUR_DATE_HERE
# For example:
# curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2019-09-05

rustup component add rust-src llvm-tools-preview clippy
cargo install cargo-xbuild cargo-binutils

Additionally, a Micro SD card with firmware files on a FAT filesystem is needed.

I recommend to get a Micro SD card USB adapter (many manufacturers ship SD cards with such an adapter), so that you can connect the card to any desktop computer just like an USB stick, no special card reader interface required (although many laptops have those these days).

You can create an MBR partitioning scheme on the SD card with an LBA FAT32 (type 0x0C) partition, format it and copy bootcode.bin, start.elf and fixup.dat onto it. Delete all other files or booting might not work. Alternatively, you can download a raspbian image, dd it to the SD card, mount it and delete the unnecessary .img files. Whichever you prefer. What's important, you'll create kernel8.img with these tutorials which must be copied to the root directory on the SD card, and no other .img files should exists there.

I'd also recommend to get an USB serial debug cable. You connect it to the GPIO pins 14/15.

UART wiring diagram

Then, run screen on your desktop computer like

sudo screen /dev/ttyUSB0 115200

Exit screen again by pressing ctrl-a ctrl-d

License

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