{"id":19608636,"url":"https://github.com/sel4/rust-sel4","last_synced_at":"2025-04-05T12:07:36.613Z","repository":{"id":178565105,"uuid":"662052340","full_name":"seL4/rust-sel4","owner":"seL4","description":"Rust support for seL4 userspace","archived":false,"fork":false,"pushed_at":"2024-10-24T09:18:29.000Z","size":3810,"stargazers_count":117,"open_issues_count":26,"forks_count":14,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-10-25T05:47:08.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seL4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSES/Apache-2.0.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":"support/targets/README.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-04T08:54:16.000Z","updated_at":"2024-10-24T09:18:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"746adb32-21c0-49d0-b320-a6addd98cb9e","html_url":"https://github.com/seL4/rust-sel4","commit_stats":null,"previous_names":["coliasgroup/rust-sel4"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Frust-sel4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Frust-sel4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Frust-sel4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seL4%2Frust-sel4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seL4","download_url":"https://codeload.github.com/seL4/rust-sel4/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332609,"owners_count":20921853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:16:05.377Z","updated_at":"2025-04-05T12:07:36.593Z","avatar_url":"https://github.com/seL4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n     Copyright 2023, Colias Group, LLC\n\n     SPDX-License-Identifier: CC-BY-SA-4.0\n--\u003e\n\n# Rust support for seL4 userspace\n\nThis repository contains crates for supporting the use of Rust in\n[seL4](https://github.com/seL4/seL4) userspace. So far, this includes:\n\n- Rust bindings for the seL4 API ([source](./crates/sel4))\n- A runtime for root tasks ([source](./crates/sel4-root-task))\n- A runtime for [seL4 Microkit](https://github.com/seL4/microkit) protection domains\n  ([source](./crates/sel4-microkit))\n- A [CapDL](https://docs.sel4.systems/projects/capdl/)-based system initializer ([source and\n  docs](./crates/sel4-capdl-initializer))\n- A loader for the seL4 kernel ([source and docs](./crates/sel4-kernel-loader))\n- Custom `rustc` target specifications for seL4 userspace ([JSON and docs](./support/targets))\n- Many more crates for use in seL4 userspace\n\nThe [./hacking](./hacking) directory contains scripts for developing and testing these crates using\nNix and, optionally, Docker.\n\nThis work is funded by the [seL4 Foundation](https://sel4.systems/Foundation/).\n\n### Rendered rustdoc\n\n[https://sel4.github.io/rust-sel4/](https://sel4.github.io/rust-sel4/)\n\n### Compatible versions of related seL4 Foundation projects\n\nThis project builds upon [seL4](https://github.com/seL4/seL4) and the [seL4\nMicrokit](https://github.com/seL4/microkit). In particular, this project works with at least the\nfollowing versions of those related projects:\n\n- seL4, when used without Microkit:\n  [`cd6d3b8c25d49be2b100b0608cf0613483a6fffa`](https://github.com/seL4/seL4/tree/cd6d3b8c25d49be2b100b0608cf0613483a6fffa)\n  (version 13.0.0, on [github.com/seL4/seL4:master](https://github.com/seL4/seL4/tree/master))\n- seL4, when used with Microkit:\n  [`968d8f6f97a37ea315243510348e933b612319f1`](https://github.com/seL4/seL4/tree/968d8f6f97a37ea315243510348e933b612319f1)\n  (on [github.com/seL4/seL4:microkit](https://github.com/seL4/seL4/tree/microkit))\n- seL4 Microkit:\n  [`8aeb9f9006cf61180dea11a0a00a084a49833066`](https://github.com/seL4/microkit/tree/8aeb9f9006cf61180dea11a0a00a084a49833066)\n  (version 2.0.0, on [github.com/seL4/microkit:main](https://github.com/seL4/microkit/tree/main))\n\n### Demos\n\n- Simple root task: https://github.com/seL4/rust-root-task-demo\n- Simple system using the seL4 Microkit: https://github.com/seL4/rust-microkit-demo\n- HTTP server using the seL4 Microkit: https://github.com/seL4/rust-microkit-http-server-demo\n\n### Overview of crates\n\n##### General crates\n\n- [`sel4`](./crates/sel4): Straightforward, pure-Rust bindings to the seL4 API.\n- [`sel4-sys`](./crates/sel4/sys): Raw bindings to the seL4 API, generated from the libsel4 headers\n  and interface definition files. This crate is not intended to be used directly by application\n  code, but rather serves as a basis for the `sel4` crate's implementation.\n- [`sel4-config`](./crates/sel4/config): Macros and constants corresponding to the seL4 kernel\n  configuration. Can be used by all targets (i.e. in all of: application code, build scripts, and\n  build-time tools).\n- [`sel4-platform-info`](./crates/sel4-platform-info): Constants corresponding to the contents of\n  `platform_info.h`. Can be used by all targets, on configurations where this file exists..\n- [`sel4-sync`](./crates/sel4-sync): Synchronization constructs using seL4 IPC. Currently only\n  supports notification-based mutexes.\n- [`sel4-logging`](./crates/sel4-logging): [`Log`](https://docs.rs/log/latest/log/trait.Log.html)\n  implementation for the [`log`](https://crates.io/crates/log) crate.\n- [`sel4-shared-memory`](./crates/sel4-shared-memory): Abstractions for interacting with\n  data in shared memory.\n- [`sel4-shared-ring-buffer`](./crates/sel4-shared-ring-buffer): Implementation of shared data\n  structures used in the [seL4 Device Driver Framework](https://github.com/au-ts/sddf).\n- [`sel4-async-*`](./crates/sel4-async): Crates for leveraging async Rust in seL4 userspace.\n\n##### Runtime crates\n\n- **Root task**:\n  - [`sel4-root-task`](./crates/sel4-root-task): A runtime for root tasks that supports thread-local\n    storage and unwinding, and provides a global allocator.\n- **seL4 Microkit**:\n  - [`sel4-microkit`](./crates/sel4-microkit): A runtime for [seL4\n    Microkit](https://github.com/seL4/microkit) protection domains, including an implementation of\n    libmicrokit and abstractions for IPC.\n\n##### Complete programs\n\n- [`sel4-capdl-initializer`](./crates/sel4-capdl-initializer): A\n  [CapDL](https://docs.sel4.systems/projects/capdl/)-based system initializer.\n- [`sel4-kernel-loader`](./crates/sel4-kernel-loader): A loader for the seL4 kernel, similar in\n  purpose to [elfloader](https://github.com/seL4/seL4_tools/tree/master/elfloader-tool).\n\n### Integrating these crates into your project\n\nThe best way to learn how to integrate these crates into your project is to check out the concrete\nexamples of their use [listed above](#demos).\n\nThese crates are not yet hosted on [crates.io](https://crates.io). Use them either as Git or path\nCargo dependencies.\n\nSome of these crates depend, at build time, on external components and configuration. In all cases,\ninformation for locating these dependencies is passed to the dependant crates via environment\nvariables which are interpreted by `build.rs` scripts. Here is a list of environment variables and\nthe crates which use them:\n\n- `sel4-config` and `sel4-sys`, whose dependants include `sel4`, `sel4-root-task`, `sel4-microkit`,\n  and many more, use `$SEL4_INCLUDE_DIRS` (defaulting to `$SEL4_PREFIX/libsel4/include` if\n  `$SEL4_PREFIX` is set) which must contain a colon-separated list of include paths for the libsel4\n  headers. See the the `sel4` crate's rustdoc for more information.\n- `sel4-platform-info`, whose dependants include `sel4-kernel-loader`, uses `$SEL4_PLATFORM_INFO`\n  (defaulting to `$SEL4_PREFIX/support/platform_gen.yaml` if `$SEL4_PREFIX` is set) which must\n  contain the path of the `platform_gen.yaml` file from the seL4 kernel build system.\n- `sel4-kernel-loader` uses `$SEL4_KERNEL` (defaulting to `$SEL4_PREFIX/bin/kernel.elf` if\n  `$SEL4_PREFIX` is set) which must contain the path of the seL4 kernel (as an ELF executable).\n\n### Quick start for running the tests in this repository\n\nThe only requirements for building and running the tests in this repository are Linux, Make,\n[rustup](https://rustup.rs/), and [Nix](https://nix.dev/). This repository contains scripts for\nsetting up a Docker container with a suitable development environment in case you aren't on Linux or\ndon't want to install Nix.\n\nFirst, clone this repository:\n\n```\ngit clone https://github.com/seL4/rust-sel4\ncd rust-sel4\n```\n\nIf you are using Docker, build, run, and enter a Docker container for development. This container\nmounts this repository's top-level at `/work`.\n\n```\ncd hacking/docker \u0026\u0026 make run \u0026\u0026 make exec\n```\n\nAt this repository's top-level directory, build and simulate a simple seL4-based system with a [root\ntask](./crates/examples/root-task/example-root-task) written in Rust (this will take a few minutes):\n\n```\nmake example # use 'ctrl-a x' to exit the simulation\n```\n\nBuild and run all of this repository's automated tests:\n\n```\nmake run-tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsel4%2Frust-sel4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsel4%2Frust-sel4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsel4%2Frust-sel4/lists"}