A lightweight OS in library form to create games for the Pi like in the old days (a'la Nintendo 64).
salmiak
is the OS library for interacting with the Raspberry Pi 3
hardware and sneka
is the proof of concept game.
Using Nix means that you have a repeatable setup that works on any (Unix) machine and you do not have to modify the state of the machine since the environment of the nix shell is dropped when it is closed. Neat, huh!?
- Install Nix
- run
nix-shell
in the root of the repo and you will get a shell with everything needed (inluding QEMU).
- Install Rust and the nightly toolchain
- Add src (to nightly):
$ rustup component add rust-src
- Install cargo xbuild:
$ cargo install cargo-xbuild
- Make sure you have
llvm-objcopy
. If the executable is not called that, you can provide a variable to the make command below likemake LLVM-OBJCOPY=my-objcopy
.
To build, just issue
$ make
To run the build code in QEMU (assuming you have it installed), issue
$ make run
Tests are run on the host platform by issuing
$ make test
which is an alias for cargo test
.
Clippy is a linter to check for common mistakes in the code. It can be run by issuing
$ make clippy
This requires clippy to be installed which can be done for your toolchain with rustup component add clippy
.
rustfmt is a tool for formatting Rust code according to style guidelines. A check for format issues can be run on the codebase by issuing
$ make format
This requires rustfmt to be installed which can be done for your toolchain with rustup component add rustfmt
.
To run all checks (test + format + clippy) issue
$ make check
This, in addition to just make
is what the CI checks.