libsel4-sys

Overview

Builds the sel4 kernel and generates Rust bindings around it, as configured by a feL4 manifest.

This library provides thin Rust bindings around the seL4 codebase; more idiomatic Rust wrappers for the enclosed functionality will be supplied in other crates.

Intended for use in projects managed by cargo-fel4, see that repository for introductory materials.

Getting Started

Dependencies

libsel4-sys uses git submodules to make seL4 related code available locally. Building the seL4 code requires several system dependencies to be installed. The few Rust dependencies are managed by Cargo.toml, so Cargo is necessary, as well as Xargo for cross-compilation. Rustup is the recommended Rust toolchain manager.

Building

This project is intended to be built in the context of the cargo fel4 command, which manages the piping of key environment variables relevant to the downstream project.

Installation

libsel4-sys may be included in your Rust project by including it in your Cargo.toml.

Usage

The generated bindings should be treated as relatively ephemeral and dynamic compared to most Rust libraries. The output is context-specific to the target (e.g. "armv7-sel4-fel4") and the set of configuration flags derived from the input feL4 manifest file.

See the Rust docs for a surface-level overview of the raw APIs exposed.

bash RUST_TARGET_PATH=$PWD/test_configs FEL4_MANIFEST_PATH=$PWD/test_configs/fel4.toml xargo doc --target x86_64-sel4-fel4 -vv

Examples

Tests

Currently, all testing is done one level up, in the cargo-fel4 repo, which has the capability to auto-generate the appropriate test runner code and exercise the resultant artifacts.

Building

See the cargo-fel4 repository for its build and installation.

Running

Once cargo-fel4 and the libsel4-sys dependencies are installed, you should be able to run:

bash cargo fel4 new tests cd tests cargo fel4 test build cargo fel4 test simulate

License

Please see the LICENSE file for more details