Git Product home page Git Product logo

crust-os's Introduction

CRust-OS

Xen-based unikernel in Rust

crust-os's People

Contributors

kanetkarster avatar sacooper avatar steveklabnik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crust-os's Issues

Panic support

Rust implements "panics" (equivalent to C++ exceptions). They're used throughout the standard library, including when allocating memory through Box::new.

To support panics, we need to implement ::rt::begin_unwind and possibly ::rt::begin_unwind_fmt. A good first implementation would print to the emergency console and immediately crash.

Enables:

Fix stack direction

We got our metaphors wrong, and our STACK_BOTTOM is a higher number than our STACK_TOP.

Two changes:

  • Exchange STACK_TOP and STACK_BOTTOM in the .lds linker script
  • mov $STACK_TOP, %rbp in start.S

Publish documentation

This is a longer-term goal, we still need to agree on a strategy for documenting code.

We should use cargo doc on our code base (see here) and publish the results online.

XenStore driver

Necessary to implement device discovery. Chapter 8 of the book.

Make compiled binaries executable

ELF files have a PT_INTERP section specifying what "interpreter" should be used to run them, if any. The default is usually something like /lib/elf/ld-linux.so.1, but it wouldn't be too hard to point to a script somewhere (/etc/crust/run, for example) which just calls xl create -c /etc/crust/crust.cfg 'name="$(RANDOM_GUID)"' 'kernel="$1"'.

Port `libstd`

Supporting libstd would let us take arbitrary Rust code (modulo asm!, #[cfg(target_os = "linux")], etc.) and compile it to run on Crust.

The vast majority of crates (libraries, etc.) in the Rust ecosystem depend on libstd. Users should be able to write programs for Crust that depend on third-party crates.

Revise and document the PFN/MFN stuff

There's some important functionality in src/xen/arch/x86_64/mem.rs that's slightly sketchy. It'd be good to look it over, and link to resources on the topic where relevant.

Make `start_info_page` a global variable

start_info_page is currently being passed into main, but that's incompatible with the typical signature for main as int main(int argc, char** argv). It should be made a global variable instead.

Enables: #24

Research integrating LWIP

Integrating LWIP would allow us to add networking, without implementing all networking ops from scratch. As this is what Mini-OS uses, it appears to be a viable alternative.

Implement prologue

Before calling main, there are quite a few subsystems we need to initialize. The bootloader in boot/start.S should call a prologue function, which should itself call main after performing initialization.

Port `libtest`

Would enable the use of cargo test --no-run for unit tests and cargo bench --no-run for benchmarks.

Requires:

Memory allocation

Crust needs heap allocation.

  • Do we need virtual memory management? (Likely not)
  • What symbols are we expected to provide?
  • Actually implement it.

Implement stdout via guest console

We've already implemented support for printing to the Hypervisor console (also called "debugging console" or "emergency console"), which can be read via xl dmesg. However, it would be nice to support printing to the guest console, if only as a way to provide a meaningful stdout for Crust applications.

Requires:
#22

Remove `#[repr(C)]` on FFI enums

Rust enums can be represented in memory as either scalar types or as the default representation for C enums on that platform. The latter is almost never correct, and it should be replaced with the appropriate value.

Compile newlib on Mini-OS

On one hand, Mini-OS uses some kind of compiler flag voodoo to build Xen images without a cross-compiler. On the other, Newlib's build system is notoriously finicky, and it's usually built with a cross-compiler.

Let's bridge that gap somehow and get Newlib and Mini-OS to compile together into a Xen image.

Support shared info page

Xen's "shared info page" is used to communicate to VMs important information related to concurrency, time-keeping, memory management, and event handling.

Adjust Heap and Stack Sizes

We need to determine what to use for the Stack and Heap size.

Currently, if we extend the size of the heap too much, we get a general protection fault while trying to allocate memory

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.