After attempting to strip down Linux kernel to remove any unnecessary driver & support and achieve minimal size and performant Linux kernel, another motivation to write own kernel was born as a research & experiment done afterwork. The main purpose of the project is to attempt to ship embed software right into kernel itself, so it's native and booting kernel will run everything necessary.
This project doesn't accept PRs as it's very immature and not well shaped yet. This project is just an experiment conducted in Kibertexnik and maintained by @orzklv himself.
- Written on Rust
- Monolith model
- Raspberry 3, 4, 5
- Conditional targetting
- Embedded software/product
Setting up Rust embedded toolchain is a bit of tidious proceses. Therefore, a few prerequisite software should be installed before you start working with the project.
If you have Nix package manager installed on your machine or your Linux distribution happens to be NixOS, then you're partially ready to go just by executing (I've already done the dirtiest job part for you):
nix develop -c $SHELL
If you don't have Nix package manager installed machine and you want to do everything imperative way, just open shell.nix:17-45 and install whatever software inside this array. After doing so, you need to install nightly version of Rust programming language toolchain with the exact version stated in rust-toolchain.toml. Also, don't forget to install target specific standard library "rust-src" and components as stated in toolchain file. I don't know what operating system you do use, so you gotta figure out yourself how to get these installed, my responsibility ends at provoding full Nix & Docker dev container support.
Make sure to have docker installed on your computer to be able to run development container which will help you to utilize ARM embedded tooling. Well, I'm not going to teach you how to install docker on your PC, you're free to google it. Just make sure it is installed and running on background. I tried my best to create the dev env entirely on Nix, but imperative nature of Arm LLC won't let me do so.
After the installation process, you need to decide whether will you build the devkit image from scratch (recommended if you have couple CPU cores biting dust in the corner) or fetch daily built image from our registry.
If you decide to fetch pre-built image:
docker pull ghcr.io/kibertexnik/sark-dev:main
If you decide to build image locally from scratch:
cd ./.github/docker && make local
Now when you're done with setting up all necessary stuff to proceed with development, a few things you should know:
I wrote a huge ass Makefile to simplify environment & args settings. You can execute:
make test
- Run tests to make sure correct kernel behaviormake qemu
- Compiling & running compiled image on qemu emulatormake clippy
- Linting rust codebase with clippymake clean
- Clean up compiled ojbects and binariesmake readelf
- Parse and show ELF header metatagsmake objdump
- Explore binary's assembly instruction setsmake doc
- Open developer documentation (mostly from author)make nm
- Explore binary's command sequence
There are few properties that can be set to change compilation behavior. Let's start with:
BSP
- this property is used to specify the geneartion of raspberry's board to which compiler will compile for and emulate images on. Refer to for moreSERIAL
- specify whether the emulated environment should show assembly of running image or serial outputs. Refer to for moreDOCKER
- use only docker or nix environment in all commands. [WIP]
There are also some developer/maintainer written documentation acrosos all codebases which can be accessed either by running make doc
or opening https://kibertexnik.github.io/sark.
This project is licensed under dual licensing as the Apache-2.0 and MIT License - see the LICENSE-APACHE or LICENSE-MIT file for details.