Giter VIP home page Giter VIP logo

hermit-rs's Introduction

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)

  • Add the hermit dependency for hermit targets in Cargo.toml.

    cargo add --target 'cfg(target_os = "hermit")' hermit
  • Make sure we link against hermit in main.rs:

    #[cfg(target_os = "hermit")]
    use hermit as _;

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.

hermit-rs's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.