Wask (will be) an operating system, written in Rust, running WebAssembly. It uses a microkernel architecture.
Since WebAssembly was designed to be a safe language, we can run it without having to use hardware usermode and multiple address spaces. This enables higher performance and opens more possibilities to implement a microkernel. You can read more about "Why a microkernel?" below. Check out the goals / ideas section.
Currently there are two folders:
wasm_test folder contains a normal rust project, meant for my experimenting with Cranelift. Eventually, the work in
wasm_test will be merged into the kernel itself.
I'll be working on Wask when I have time, commits may happen at random times, depends on school.
These instructions help you get started with building the source and getting it to run.
Setting up a toolchain
- grub-mkrescue (you might also need to install xorriso)
You can setup your toolchain using the following steps:
# You'll need to get the rust nightly and install cargo-xbuild: rustup component add rust-src cargo install cargo-xbuild # You'll also need a cross-compile binutils, I wrote a bash script that builds this for you. cd toolchain ./setup_cross_binutils.sh
Now you're ready to build and run the project!
Building & Running
There's currently a Makefile in the
kernel folder. The Makefile there provides some rules:
cd kernel # If not already there make run # Builds iso and start a QEMU virtual machine make iso # Only builds the iso # You can make a release build using: make iso BUILD=release # (or run) # You can run tests using ./run_tests
wasm_test folder is just a normal rust project and can be run using
Interested in contributing to the project? Check the issues for TODO items.
- Finish physical frame allocator + paging + heap
- Getting some simple wasm running
- Simple PS/2 server & similar small servers
- Port my C++ kernel to Rust
- Improve my Rust skills
- Get a better understanding of WebAssembly
- Cranelift - Code generator used to parse & run WebAssembly
History (aka why a microkernel?)
Because we run a safe language as "userspace", we don't need all those hardware protections that would otherwise slow down a microkernel. I always found the design and flexibility of a microkernel very interesting, but was bothered by the performance impact and how hard it is to integrate it with (for example) POSIX and make it performant. Another idea is that, since we compile the wasm at application start, we could do some very platform-specific optimisations.
I originally started with a C++ microkernel, but found the performance overhead of doing things securely annoying. Then I stumbled across about Cranelift and got the idea of bringing it into my kernel. However, since my kernel was C++, it was hard to do. This is why I decided to switch to Rust.