• Stars
    star
    276
  • Rank 148,566 (Top 3 %)
  • Language
    Rust
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

mini-lsm

A tutorial of building an LSM-Tree storage engine in a week! (WIP)
Rust
1,157
star
2

type-exercise-in-rust

Learn Rust black magics by implementing an expression framework in database systems
Rust
1,154
star
3

chicv

Chi CV Template (For Typst)
304
star
4

canvas_grab

๐ŸŒ One-click script to synchronize files from Canvas LMS.
Python
208
star
5

RISCV-Simulator

๐Ÿ’ป RISC-V Simulator of RV32I ISA. 5-stage pipeline / out-of-order execution with Tomasulo algorithm and Speculation. Support runtime visualization. Project report available.
C++
154
star
6

raytracer.rs

โšก A high-performance path tracer implemented in Rust based on "Ray Tracing in One Weekend" featuring static dispatch, multi-threaded rendering and a variety of preset scenes.
Rust
92
star
7

HallOfShame

Hall of Shame
67
star
8

raytracer-tutorial

raytracer project for PPCA 2020
Rust
60
star
9

linux-kernel-labs

Linux kernel labs
C
53
star
10

make-a-fortune

An open-source anonymous forum frontend.
TypeScript
53
star
11

raft-kvs

โ›ต A distributed key-value store based on Raft. (WIP)
Rust
42
star
12

notes

Lecture notes at SJTU
C
40
star
13

mips-simulator

๐Ÿ’ป A 5-stage pipeline MIPS CPU design in Haskell.
Haskell
33
star
14

uring-positioned-io

Async positioned I/O with io_uring.
Rust
32
star
15

mips-cpu

๐Ÿ’ป A 5-stage pipeline MIPS CPU implementation in Verilog.
Verilog
26
star
16

BlueSense

๐ŸŒˆ BlueSense is a long-term project for monitoring Shanghai environment data.
Vue
25
star
17

fourier-transform-drawing

Inspired by 3Blue1Brown. Apply fourier transform to an SVG path and draw the result on canvas.
HTML
22
star
18

skyzh-site

Alex Chi's personal site
MDX
20
star
19

rust-ycsb

YCSB in Rust (WIP)
Rust
19
star
20

Meteor

๐Ÿš† Fine-grained analysis and visualization of Hangzhou Metro for efficient traveling in metro system. Project report, slide and presentation video included.
C++
18
star
21

pg_poop

A Postgres extension that rewrites strings to ๐Ÿ’ฉ
C
16
star
22

zoom-url-generator

Generate Zoom URL
HTML
16
star
23

bustub-web-shell

BusTub web shell
HTML
15
star
24

skyzh

12
star
25

BPlusTree

๐ŸŒฒ Fully unit-tested B+ tree with basic paging implemented in C++
C++
11
star
26

SJTU_Diploma

ไบคๅคงๅญฆ็ง‘ไบคๆต็พคๅˆ—่กจ (Originally made by @LuminousXLB) ้กน็›ฎๅทฒ่ฟ็งปๅˆฐ @SJTU-Plus
HTML
11
star
27

julia.metal

๐ŸŽ‡ Render Julia Sets in real-time with Metal API on macOS
Swift
8
star
28

go-dht

๐ŸŒŽ Chord in golang
Go
8
star
29

SJTU-RM-Hurricane

๐ŸŒช๏ธ An extensible task-based robot control system on STM32 embedded platforms made for SJTU RoboMaster Competition, using open-source toolchain OpenSTM32
C++
8
star
30

chaos-video

Course Project of CS339 Computer Networks
JavaScript
7
star
31

r-by-example

๐Ÿ“š Solutions for the book "R by Example"
R
6
star
32

tenitsu

๐ŸŽพ A robot automatically finds and fetches tennis balls on the ground. Use OpenCV on Android for computer vision. Final project for SJTU ME116 "IntroME".
Kotlin
6
star
33

fishing

Yet another boring fishing game
JavaScript
5
star
34

oom_killer

Project 2 of SJTU CS356 Operating System Projects
Makefile
5
star
35

data-structure-deque

A deque of O(sqrt n) complexity on access, insert and remove, with an optimization for O(log n) access based on fenwick tree.
C++
5
star
36

CloudOJ

๐ŸŒฉ๏ธ (DEPRECATED) An Online Judge. Deprecated due to low efficiency and security issues.
PHP
4
star
37

fish-agent-simulation-mcm2020

๐ŸŸ๐ŸŸ An agent-based model for simulating fish distribution in North Atlantic.
Rust
4
star
38

game-theory-on-matrix

An agent-based model for researching game theory dynamics on matrix-like structure.
Python
4
star
39

the-tale-of-slime

Yet another boring game. No textures, no graphics, just shapes. WIP. Working on this game only when I'm boring.
JavaScript
4
star
40

ddcm-protocol

๐ŸŒ A protocol based on Kademlia and designed for peer-to-peer distrubuted computing
Python
4
star
41

kvs

Key-Value Store [Practical Networked Applications in Rust]
Rust
3
star
42

BlueMarine

๐ŸŒƒ Collect climate data from embedded devices with serial connection and BLE. Part of the BlueSense project.
Python
2
star
43

bustub-btree-shell

2
star
44

bors-playground

Rust
2
star
45

lisp-interpreter

๐Ÿ’Ž A Lisp interpreter in Ruby
Ruby
2
star
46

MrSans

๐Ÿค– Mr. Sans is a bot reporter for BlueSense. Part of the BlueSense project.
Go
1
star
47

BlueMonitor

๐ŸŒƒ Blue Sense: Sense of Blue Sky. This is the Raspberry Pi part of Blue Sense.
Python
1
star
48

prosea

๐Ÿ“š A crowdsourced contest solution sharing platform built for online STEM test of Innovation Competition
JavaScript
1
star
49

conway.ts

Conway's Game of Life in TypeScript
TypeScript
1
star
50

sjtuctf-2019-writeup

โ“ Solutions and exploitation snippets for SJTU CTF 2019
Python
1
star
51

serialpb

Reliable packet transmission over serial interface
C++
1
star
52

FlyThat

Code for Kaggle in-class competition
Python
1
star