Skip to content

oscourse-tsinghua/rcore_plus

 
 

Repository files navigation

rCore Labs

Build Status

Rust version of THU uCore OS Labs.

Going to be the next generation teaching operating system.

Supported architectures: RISCV32

Tested boards: QEMU

Dev docs (in Chinese)

demo

Building

Environment

How to run

rustup component add rust-src
cargo install cargo-xbuild bootimage
git clone https://github.com/oscourse-tsinghua/rcore_plus.git --recursive
git checkout lab8-rv32
git submodule update --init --recursive
cd rcore_plus/riscv_pk
git checkout lab8-rv32
cd ../kernel
make run arch=riscv32

QA

Q: When you make build, you got compiler error "Can not find ~/.rustup/toolchains/nightly-2019-01-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcompiler_builtins/". How to fix it?

A:

1. add one line below [dependencies] in Cargo.toml 
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins" }
2. in kernel DIR: make build, then cargo will download compiler_builtins in ~/.cargo
3. cp -r ~/.cargo/git/checkouts/compiler-builtins-ec094dc45a0179c8/61a3c5a89ddf/ ~/.rustup/toolchains/nightly-2019-01-27-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcompiler_builtins/

Q: when you update rust-toolchain to nightly-2019-02-16, you can not compile libcore, liballoc correctly. How to fix it?

A: install rust-src, update/reinstall cargo-xbuild

rustup component add --toolchain nightly-2019-02-16 rust-src
cargo install cargo-xbuild --force

History

This is a project of THU courses:

  • Operating System (2018 Spring)
  • Comprehensive Experiment of Computer System (2018 Summer)
  • Operating System Train (2018 Autumn)

Project wiki (internal access only): OS, CECS, OST

Lab docs, Reports (in Chinese): docs

It's based on BlogOS , a demo project in the excellent tutorial Writing an OS in Rust (First Edition).

License

The source code is dual-licensed under MIT or the Apache License (Version 2.0).

About

Rust version of THU uCore OS. Linux compatible.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 85.6%
  • Python 11.3%
  • Assembly 1.3%
  • Makefile 0.9%
  • Shell 0.7%
  • C 0.1%
  • Other 0.1%