cargo-fel4

Overview

A cargo subcommand for automating feL4 (seL4 for Rust) development

cargo-fel4 seeks to accelerate the pace of Rust development for seL4 environments by automating away the annoyances of building the underlying seL4 codebase, generating useable Rust bindings, and providing a way to get your code into a runnable seL4 application.

Once installed, use cargo fel4 new my-project to create a new feL4 project, which is a regular Rust no_std library project with a few additional configuration frills.

In that project, running cargo fel4 build will generate a seL4 application wrapping your library code from src/lib.rs, and cargo fel4 simulate will run it.

Access to seL4 capabilities is presently through the libsel4-sys library, a thin binding layer around seL4. This wrapper is built and configured according to your feL4 project settings, stored in your project's fel4.toml manifest file.

feL4 projects come with a example property-based test suite to demonstrate how to conduct tests in the feL4 context. Try it out with cargo fel4 test build && cargo fel4 test simulate

cargo-fel4 is released with additional special thanks and attribution to Robigalia, particularly for their startup assembly code and example conventions W.R.T. language items, and of course, to Data61, et al for seL4.

Getting Started

Dependencies

cargo-fel4 works on top of several other tools to operate, so you'll need Rust with Cargo, Xargo, and QEMU to build and run feL4 projects. Additionally, feL4 depends on the libsel4-sys crate, which has its own set of dependencies. Some of the "Building" steps below are actually specific to satisfying libsel4-sys dependencies. cargo-fel4 was developed using Ubuntu Xenial, but other Linux variants should work.

Building

These instructions cover installing both libsel4-sys and cargo-fel4 dependencies as well as building cargo-fel4.

Installation

After building, cargo-fel4 can be installed with cargo install.

Usage

See the output of cargo fel4 --help for more details.

```bash cargo fel4 --help

A cargo subcommand for automating feL4 (seL4 for Rust) development

USAGE: cargo fel4

FLAGS: -h, --help Prints help information -V, --version Prints version information

SUBCOMMANDS: build Build a feL4 project clean Remove generated artifacts deploy Deploy a feL4 project help Prints this message or the help of the given subcommand(s) new Create a new feL4 project simulate Simulate a feL4 project with QEMU test Build and run feL4 tests ```

Examples

Tests

cargo-fel4 manages its own tests with the standard Rust test framework, plus proptest for property-based testing.

Building

Building the tests is as simple as:

bash cargo build --tests

Running

Running the tests for cargo-fel4 (as opposed to the tests within a given feL4 project) requires installing the standard dependencies listed earlier. cargo-fel4's internal tests can be exercised by running:

bash cargo test

License

Please see the LICENSE file for more details