hermit-os / hermit-rs-template

An application template for Hermit for Rust.
BSD Zero Clause License
29 stars 10 forks source link

hermit-rs-template

An application template for Hermit for Rust.

Requirements

Transform your application into a Hermit image:

(this is already done in this repo)

Usage

Install the Rust Standard Library for Hermit

See rust-std-hermit.

Note that rust-std-hermit is not available for the stable toolchain channel but for specific channels of stable Rust versions. See rust-toolchain.toml.

Build the Hermit Application

$ cargo build --target x86_64-unknown-hermit

Run the Application in Uhyve

$ uhyve target/x86_64-unknown-hermit/debug/hermit-rs-template

For more details, see uhyve's README.

Run the Application in QEMU

Download the loader binary from its releases page.

$ qemu-system-x86_64 \
    -cpu qemu64,apic,fsgsbase,fxsr,rdrand,rdtscp,xsave,xsaveopt \
    -smp 1 -m 128M \
    -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
    -display none -serial stdio \
    -kernel hermit-loader-x86_64 \
    -initrd target/x86_64-unknown-hermit/debug/hermit-rs-template

For more details, see the loader's README.