rusty-hermit 0.3.34

A Rust-based library operting system
Documentation

libhermit-rs - A Rust-based library operting system

Build Status Actions Status License Slack Status

RustyHermit is a unikernel targeting a scalable and predictable runtime for high-performance and cloud computing. Unikernel means, you bundle your application directly with the kernel library, so that it can run without any installed operating system. This reduces overhead, therefore, interesting applications include virtual machines and high-performance computing.

libhermit-rs is the heart of RustyHermit and is the kernel itself. The kernel is able to run Rust applications, as well as C/C++/Go/Fortran applications.

Prerequisites

The Rust toolchain can be installed from the official webpage. RusyHermit currently requires the nightly versions of the toolchain.

rustup default nightly

Further requirements are the source code of the Rust runtime, and llvm-tools:

rustup component add rust-src
rustup component add llvm-tools-preview

Building the kernel as static library

The kernel will be linked as static library to C/C++ or Rust applications. In case of Rust, the crate hermit-sys automate this process. For C/C++ applications a modified C/C++ compiler has to be used. To build the kernel as static library and to link afterwards by its own to the applicatiom, please use following build command:

cargo build -Z build-std=core,alloc,panic_abort --target x86_64-unknown-hermit-kernel

The resulting library then can be found in target/x86_64-unknown-hermit-kernel/debug/

Controlling the number of kernel messages

libhermit-rs uses the lightweight logging crate log to print kernel messages. If the environment variable HERMIT_LOG_LEVEL_FILTER is set at compile time to a string matching the name of a LevelFilter, then that value is used for the LevelFilter. If the environment variable is not set, or the name doesn't match, then LevelFilter::Info is used by default, which is the same as it was before.

For instance, the following command build RustyHermit with debug messages:

$ HERMIT_LOG_LEVEL_FILTER=Debug cargo build -Z build-std=core,alloc,panic_abort --target x86_64-unknown-hermit-kernel

Credits

libhermit-rs is derived from following tutorials and software distributions:

  1. Philipp Oppermann's excellent series of blog posts.
  2. Erik Kidd's toyos-rs, which is an extension of Philipp Opermann's kernel.
  3. The Rust-based teaching operating system eduOS-rs.

HermitCore's Emoji is provided for free by EmojiOne.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

libhermit-rs is being developed on GitHub. Create your own fork, send us a pull request, and chat with us on Slack