Announce: RusPiRo - a kernel the Rust way ;)
Posted: Thu Aug 01, 2019 8:26 am
Hi there,
it has been a while since I've been searching for answers, support and hints on this forum and all of you always had been a great help!
Now I thought it might be time to give something back to the community which could be helpful for others as well.
I've recently started learning Rust as programming language and kinda 'fell in love' with it. One of the strength from my point of view is module system which allows you to very easy hook different features into your environment by just referring to them in a dependency. However, here goes the announcment:
RusPiRo
The overarching goal is to build a Rust RaspberryPi Robotic system for a small roboter I have in my mind. The aim is to provide while building the project simple as self contained as possible building blocks (crates in Rust terms) for re-usability that allows others to mix-and-match the features they want to re-use and start building their own when needed.
The current target architecture of the project is Raspberry Pi 3(B+) in 32Bit bare metal.
When searching ruspiro on https://crates.io/crates you will already find a bunch of them and more will be coming. Even though the source code repoitories are linked in on the crates.io pages they also could be found on github https://github.com/RusPiRo. Each crites.io release will usually have a corresponding release in github.
For a quick start there is also a reference baremetal kernel implementation that showcases the usage of different crates/features and also provides a good entry point for anyone's Rust bare metal RPi project: https://github.com/RusPiRo/ruspiro-kernel/releases. One might want to start with the pre-relase v0.0.0 of the kernel and check out the upcoming releases how things are done the more crates are provided and evolve over time
.
As my current build pipeline is running on a Windows 10 PC and cross compiling from there to ARMv8 some of the steps described in the README of the ruspiro-kernel github might differ on MacOS or other hosting systems.
The core/heart of any RusPiRo based kernel is the ruspiro-boot crate. This is the one that provides all the assembly sartup code to get the Raspberry Pi up and running, sets all the stack pointer, initializes MMU with a simple 1:1 memory map and kicks off all 4 cores. Each core is kicked off one after another and calls entry points that need to be provided by the kernel implementer. This crate also comes with the necessary linker script to successfully build/link all the stuff into a functional kernel binary ready to be deployed to the Raspberry Pi.
Using this crate as part of your kernel allows to immediately start in the Rust environment without the need to invent the startup assembly every time.
All the stuff is tested on a real Raspberry Pi 3B+ (no Qemu or the like).
As the Raspberry Pi 4 was released recently I also thought about support for this one as soon as more documentation is available and I do own one for testing
Have fun and thanks for reading...
Happy bare metal coding....
it has been a while since I've been searching for answers, support and hints on this forum and all of you always had been a great help!
Now I thought it might be time to give something back to the community which could be helpful for others as well.
I've recently started learning Rust as programming language and kinda 'fell in love' with it. One of the strength from my point of view is module system which allows you to very easy hook different features into your environment by just referring to them in a dependency. However, here goes the announcment:
RusPiRo
The overarching goal is to build a Rust RaspberryPi Robotic system for a small roboter I have in my mind. The aim is to provide while building the project simple as self contained as possible building blocks (crates in Rust terms) for re-usability that allows others to mix-and-match the features they want to re-use and start building their own when needed.
The current target architecture of the project is Raspberry Pi 3(B+) in 32Bit bare metal.
When searching ruspiro on https://crates.io/crates you will already find a bunch of them and more will be coming. Even though the source code repoitories are linked in on the crates.io pages they also could be found on github https://github.com/RusPiRo. Each crites.io release will usually have a corresponding release in github.
For a quick start there is also a reference baremetal kernel implementation that showcases the usage of different crates/features and also provides a good entry point for anyone's Rust bare metal RPi project: https://github.com/RusPiRo/ruspiro-kernel/releases. One might want to start with the pre-relase v0.0.0 of the kernel and check out the upcoming releases how things are done the more crates are provided and evolve over time

As my current build pipeline is running on a Windows 10 PC and cross compiling from there to ARMv8 some of the steps described in the README of the ruspiro-kernel github might differ on MacOS or other hosting systems.
The core/heart of any RusPiRo based kernel is the ruspiro-boot crate. This is the one that provides all the assembly sartup code to get the Raspberry Pi up and running, sets all the stack pointer, initializes MMU with a simple 1:1 memory map and kicks off all 4 cores. Each core is kicked off one after another and calls entry points that need to be provided by the kernel implementer. This crate also comes with the necessary linker script to successfully build/link all the stuff into a functional kernel binary ready to be deployed to the Raspberry Pi.
Using this crate as part of your kernel allows to immediately start in the Rust environment without the need to invent the startup assembly every time.
All the stuff is tested on a real Raspberry Pi 3B+ (no Qemu or the like).
As the Raspberry Pi 4 was released recently I also thought about support for this one as soon as more documentation is available and I do own one for testing

Have fun and thanks for reading...
Happy bare metal coding....