Hi all. This repository aims to provide easy reference code for programming bare metal on the Raspberry Pi 3
This repository aims to provide easy reference code for programming bare metal on the Raspberry Pi 3
in the [Rust] systems programming language.
in the [Rust] systems programming language. Emphasis is on leveraging Rust's zero-overhead abstractions to compile
It is basically a combination of two awesome resources.
lean code that is readable, concise and safe (at least as safe as it gets on bare-metal hardware).
1. First of all, it is a fork of [Zoltan Baldaszti]'s awesome [tutorial] on bare metal programming on RPi3 in `C`.
1. Rust code will be based on his files, READMEs will be adapted, and I might change things here and there if I think it is beneficial. However, credits to this guy plz!
2. The second props go to [Jorge Aparicio] for ["The Embedonomicon"], from which the boot code is taken.
[Rust]: https://www.rust-lang.org
The target audience is hobby OS developers who are new to this hardware. It will give you examples on how to do common
[Zoltan Baldaszti]: https://github.com/bztsrc
Operating Systems tasks, like writing to the serial console, reading keystrokes from it or use various peripherals like
Exit screen again by pressing <kbd>ctrl-a</kbd><kbd>ctrl-d</kbd>
Exit screen again by pressing <kbd>ctrl-a</kbd><kbd>ctrl-d</kbd>
Emulation
## Emulation
---------
QEMU currently only emulates UART0, so only the tutorials 05 and above will work, as UART1 is *not* redirected by default.
QEMU currently only emulates UART0, so only the tutorials 05 and above will work, as UART1 is *not* redirected by default.
For that, you would have to add something like `-chardev socket,host=localhost,port=1111,id=aux -serial chardev:aux` (thanks
For that, you would have to add something like `-chardev socket,host=localhost,port=1111,id=aux -serial chardev:aux` (thanks
[@godmar](https://github.com/godmar) for the info).
[@godmar](https://github.com/godmar) for the info).
**!!!WARNING!!!** Qemu emulation is rudimentary, only the most common peripherals are emulated! **!!!WARNING!!!**
**!!!WARNING!!!** Qemu emulation is rudimentary, only the most common peripherals are emulated! **!!!WARNING!!!**
Why Raspberry Pi 3?
## About this repository
-------------------
I've choosen this board for several reasons: first of all, it's cheap and easy to get. Second, it's a 64 bit
machine. I gave up programming for 32 bit long long time ago. The 64 bit is so much more interesting, as it's
address space is increadibly huge, bigger than the storage capacity which allows us to use some interesting new
solutions. Third, uses only MMIO which makes it easy to program.
For 32 bit tutorials, I'd recommend:
- [Cambridge tutorials](http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/) (ASM and 32 bit only),
The tutorial is basically a combination of two awesome resources.
- [David Welch's tutorials](https://github.com/dwelch67/raspberrypi) (mostly C, with some 64 bit examples),
1. First of all, it is a fork of [Zoltan Baldaszti]'s awesome [tutorial] on bare metal programming on RPi3 in `C`.
- [Peter Lemon's tutorials](https://github.com/PeterLemon/RaspberryPi) (ASM only, also for 64 bit) and
1. Rust code will be based on his files, READMEs will be adapted, and I might change things here and there if I think it is beneficial. However, credits to this guy plz!
- [Leon de Boer's tutorials](https://github.com/LdB-ECM/Raspberry-Pi) (C and ASM, also for 64 bit, more complex examples like USB and OpenGL).
2. The second props go to [Jorge Aparicio] for ["The Embedonomicon"], from which the boot code is taken.