GithubHelp home page GithubHelp logo

bzdula / core-os-riscv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skyzh/core-os-riscv

0.0 0.0 0.0 1.28 MB

๐Ÿ–ฅ๏ธ An xv6-like operating system on RISC-V with multi-core support. Documentation available online.

Home Page: https://skyzh.github.io/core-os-riscv/

License: MIT License

Makefile 2.71% Assembly 5.93% Rust 87.22% Python 2.20% GDB 0.09% C++ 1.37% C 0.38% HTML 0.09%

core-os-riscv's Introduction

core-os-riscv

An xv6-like operating system in Rust.

This project is originally based on "The Adventures of OS: Making a RISC-V Operating System using Rust", and is now being made to have an xv6-like structure.

You may browse this repo with Sourcegraph.

image

Build Instructions

macOS

First of all, install GNU RISC-V tools and QEMU. Python3 is also required to generate some files automatically.

brew tap riscv/riscv
brew install riscv-tools
brew test riscv-tools
brew install qemu

Don't forget to add riscv-tools to PATH.

Then, install Rust and related components.

cargo default nightly
cargo install cargo-xbuild cargo-binutils
rustup component add rust-src llvm-tools-preview rustfmt
rustup target add riscv64gc-unknown-none-elf

Finally you may build and run this project.

make qemu

If you want to use readelf tools, etc., you may install pwntools on macOS.

Ubuntu

Use Linuxbrew.

Documentation

Build Status (documentation automatically built with travis)

Documentation of this repo is automatically built and deployed with Travis. You may view online version here, syscall specification here.

make && make docs

I'll continuously add Rust-specific implementations and how I made this project into documentation.

Roadmap

Update I haven't maintained this project for a while, as I'm busy with my course-works. The long-term plan of this project is that, I'll leverage Rust async features to schedule kernel threads, therefore eliminating the need of sleeplock.

The main goal of this project is to make an xv6-like operating system with the Rust programming language. And then, I'll separate arch-dependent part and make it into an OS supporting multiple architecture and multiple boards.

  • Virtual Memory and Management
    • Virtual Memory
    • Load ELF files from memory
    • Kernel Allocator
    • Remove direct call to allocator
    • (WIP) Add guard page around stack page
  • Traps and Interrupt, Drivers
    • UART drivers
    • Machine-mode Timer Interrupt
    • External interrupt
    • Spinlock-based Virt-IO driver
    • Sleeplock-based Virt-IO driver (#2)
    • Handle signals in a Rust way (#1)
  • Process and Scheduling
    • Switch to User-mode
    • Process
    • System call
    • Scheduling
    • Test multiple process scheduling
    • Fork system call
    • Timer-interrupt-based scheduling
    • Multi-core support
    • Use initcode instead of init binary
    • Allocator and stdlib in user-space
    • (WIP) Implement wait syscall
    • Simple shell
    • Investigate frequent kernel panic (#8)
    • Reimplement process scheduling system (#9)
  • Filesystem
    • Fake fs and exec system call
    • Real spinlock instead of nulllock
    • Implement simple fs (#5)
    • Implement read, write, open, close, dup, etc. syscalls
    • Implement file-related syscalls on file system and eliminate use of Mutex (#5)
    • Implement pipe
    • Copyin and Copyout implementation
    • Don't use Box in fs implementation
  • Miscellaneous
    • (WIP) Replace Makefile with pure Rust toolchain (cargo build script)
    • Use Option instead of panic!
    • Eliminate use of unsafe
    • Documentation
    • High-level abstractions (driver, vm, etc.)
    • Port to aarch64 and deploy on Raspi
    • Rewrite and credit code from other sources
    • RISC-V codegen issues (#6)
    • Security issues (#7)

Reference

For how these projects are related to core-os, refer to #3.

License

MIT

core-os-riscv's People

Contributors

skyzh avatar onehr 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.