GithubHelp home page GithubHelp logo

anthrax3 / cervus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cervus-v/cervus

0.0 1.0 0.0 72 KB

The Cervus Subsystem for Linux

License: GNU General Public License v2.0

Rust 73.77% Makefile 0.35% Shell 0.34% C 25.54%

cervus's Introduction

cervus

A WebAssembly subsystem for Linux.

Screenshot

What's it?

Cervus implements a WebAssembly "usermode" on top of the Linux kernel (which tries to follows the CommonWA specification), enabling wasm applications to run directly in ring 0, while still ensuring safety and security.

But why?

  • Managed execution (making it possible to perform optimizations based on tracing/partial evaluation)
  • Avoid performance overhead introduced by system calls & address space switches
  • Zero-copy I/O is possible

Things that are working and not working

Working:

  • An interpreter based on HexagonE
  • Binary translation & loading based on wasm-core
  • Logging

Not working:

  • Floating point
  • JIT
  • Everything else

Build

Kernel module

Requirements:

  • xargo
  • latest nightly rust
  • kernel headers
  • gnu make & gcc
xargo build --target x86_64-unknown-none-gnu --release
cd glue
./build.sh
sudo insmod cervus.ko

Loader

This installs the cvload binary:

cd loader
cargo install

Applications

usermode/examples contains a few examples for WebAssembly applications running in Cervus.

For example, to build and load the hello_world example:

cd usermode
cargo build --example hello_world --target wasm32-unknown-unknown --release
sudo cvload target/wasm32-unknown-unknown/release/examples/hello_world.wasm

And then run dmesg | tail. If everything works well, you should see something like:

[132382.502249] cervus: (20277) [INFO] Hello, world!

Contribute

I'm busy with my College Entrance Examination until ~June 10, 2018, before which I cannot actively maintain this project. However, there are a few things that can be relatively easily worked on:

  • A JIT based on Cretonne

Since Cretonne supports no_std, this should be relatively easy compared to other JIT approaches.

Interface with the rest of the system by implementing the Backend trait, for which the interpreter-based backend located in src/backend/hexagon_e is a good example to start with.

  • File system API

Blocking filesystem I/O APIs can be added as virtual system calls, which locate in src/env.rs.

License

Cervus itself has to use the GPL 2.0 license because it links to the Linux kernel. However, user code that runs on Cervus is not limited by this.

cervus's People

Contributors

losfair avatar

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.