Skip to content

Commit 590df84

Browse files
committed
update Rust toolchain and README
NOTE: MIPS is broken due to a Rust compiler bug
1 parent 50d833e commit 590df84

File tree

5 files changed

+26
-45
lines changed

5 files changed

+26
-45
lines changed

.travis.yml

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ dist: xenial
44

55
language: rust
66

7-
rust: nightly-2019-06-15
7+
rust: nightly-2019-09-01
88

99
os:
1010
- linux
11-
# - osx # too slow and hard to fix, skip it for now
11+
- osx
1212

1313
cache:
1414
cargo: true
1515
directories:
1616
- $HOME/Library/Caches/Homebrew
17-
- $TRAVIS_BUILD_DIR/qemu-4.0.0
17+
- $TRAVIS_BUILD_DIR/qemu-4.1.0
1818

1919
addons:
2020
homebrew:
@@ -25,49 +25,32 @@ env:
2525
matrix:
2626
- ARCH="riscv64"
2727
- ARCH="riscv64" OPTS="board=u540"
28+
- ARCH="riscv64" OPTS="board=k210"
29+
- ARCH="riscv64" OPTS="board=rocket_chip"
2830
- ARCH="riscv32"
2931
- ARCH="x86_64"
32+
- ARCH="x86_64" OPTS="board=pc"
3033
- ARCH="aarch64"
3134
- ARCH="mipsel" OPTS="board=malta"
3235

33-
matrix:
34-
allow_failures:
35-
- os: osx
36-
3736
install:
38-
- if [ $ARCH = riscv32 ] || [ $ARCH = riscv64 ]; then
39-
[ $TRAVIS_OS_NAME = linux ] && export FILE="riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14";
40-
[ $TRAVIS_OS_NAME = osx ] && export FILE="riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-apple-darwin";
41-
wget https://static.dev.sifive.com/dev-tools/$FILE.tar.gz;
42-
tar xf $FILE.tar.gz;
43-
export PATH=$PATH:$PWD/$FILE/bin;
44-
fi
45-
- if [ $ARCH = aarch64 ]; then
46-
if [ $TRAVIS_OS_NAME = linux ]; then
47-
export FILE="gcc-arm-8.2-2018.11-x86_64-aarch64-elf";
48-
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.2-2018.11/$FILE.tar.xz;
49-
tar -xf $FILE.tar.xz;
50-
export PATH=$PATH:$PWD/$FILE/bin;
51-
elif [ $TRAVIS_OS_NAME = osx ]; then
52-
brew tap SergioBenitez/osxct;
53-
brew install aarch64-none-elf;
54-
fi;
55-
fi
5637
- if [ $TRAVIS_OS_NAME = linux ]; then
57-
wget https://download.qemu.org/qemu-4.0.0.tar.xz && tar xJf qemu-4.0.0.tar.xz > /dev/null && cd qemu-4.0.0 && ./configure --target-list=$ARCH-softmmu && make && cd ..;
58-
export PATH=$PATH:$PWD/qemu-4.0.0/$ARCH-softmmu:$PWD/qemu-4.0.0;
38+
wget https://download.qemu.org/qemu-4.1.0.tar.xz && tar xJf qemu-4.1.0.tar.xz > /dev/null && cd qemu-4.1.0 && ./configure --target-list=$ARCH-softmmu && make && cd ..;
39+
export PATH=$PATH:$PWD/qemu-4.1.0/$ARCH-softmmu:$PWD/qemu-4.1.0;
5940
sudo apt update;
6041
sudo apt install device-tree-compiler -y;
6142
fi
62-
- if [ $TRAVIS_OS_NAME = linux ]; then
43+
- if [ 1 ]; then
6344
[ $ARCH = riscv32 ] && export FILE="riscv32-linux-musl-cross";
6445
[ $ARCH = riscv64 ] && export FILE="riscv64-linux-musl-cross";
6546
[ $ARCH = mipsel ] && export FILE="mipsel-linux-musln32-cross";
6647
[ $ARCH = aarch64 ] && export FILE="aarch64-linux-musl-cross";
6748
[ $ARCH = x86_64 ] && export FILE="x86_64-linux-musl-cross";
68-
sudo apt update;
69-
sudo apt install linux-headers-$(uname -r);
49+
if [ $TRAVIS_OS_NAME = linux ]; then
7050
wget https://musl.cc/$FILE.tgz;
51+
elif [ $TRAVIS_OS_NAME = osx ]; then
52+
wget https://mac.musl.cc/$FILE.tgz;
53+
fi;
7154
tar -xf $FILE.tgz;
7255
export PATH=$PATH:$PWD/$FILE/bin;
7356
fi
@@ -77,9 +60,6 @@ before_script:
7760
- rustup component add rust-src llvm-tools-preview
7861
- (test -x $HOME/.cargo/bin/cargo-objdump || cargo install cargo-binutils)
7962
- (test -x $HOME/.cargo/bin/cargo-xbuild || cargo install cargo-xbuild)
80-
- if [ $ARCH = x86_64 ]; then
81-
(test -x $HOME/.cargo/bin/bootimage || cargo install bootimage --version 0.6.6);
82-
fi
8363

8464
script:
8565
- cd user && make sfsimg arch=$ARCH && cd ..

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ Rust version of THU [uCore OS Plus](https://github.com/chyyuu/ucore_os_plus).
66

77
Going to be the next generation teaching operating system.
88

9-
Supported architectures: x86_64, RISCV32/64, AArch64, MIPS32
9+
Supported architectures and boards:
1010

11-
Tested boards: QEMU, HiFive Unleashed, x86_64 PC (i5/i7), Raspberry Pi 3B+, Kendryte K210 and FPGA running Rocket Chip / [TrivialMIPS](https://github.com/Harry-Chen/TrivialMIPS)
11+
* x86_64: PC (i5/i7)
12+
* RISCV32/64: HiFive Unleashed, Kendryte K210, [FPGA running Rocket Chip](https://github.com/jiegec/fpga-zynq)
13+
* AArch64: Raspberry Pi 3B+
14+
* MIPS32: [TrivialMIPS](https://github.com/Harry-Chen/TrivialMIPS)
1215

1316
![demo](./docs/2_OSLab/os2atc/demo.png)
1417

1518
## Building
1619

1720
### Environment
1821

19-
* [Rust](https://www.rust-lang.org) toolchain at nightly-2019-06-15
22+
* [Rust](https://www.rust-lang.org) toolchain at nightly-2019-09-01
2023
* Cargo tools: [cargo-xbuild](https://github.com/rust-osdev/cargo-xbuild)
2124
* [QEMU](https://www.qemu.org) >= 3.1.0
22-
* [RISCV64 GNU toolchain](https://www.sifive.com/boards) (for riscv32/64)
23-
* [AArch64 GNU toolchain](https://cs140e.sergio.bz/assignments/0-blinky/) (for aarch64)
24-
* [musl-cross-make](https://github.com/richfelker/musl-cross-make) (for userland musl, or download prebuilt toolchain from [musl.cc](https://musl.cc/))
25+
* [musl-based GCC toolchains](https://musl.cc/)
2526

2627
See [Travis script](./.travis.yml) for details.
2728

@@ -62,6 +63,7 @@ This is a project of THU courses:
6263
* [Comprehensive Experiment of Computer System (2018 Summer)](http://os.cs.tsinghua.edu.cn/oscourse/csproject2018/group05)
6364
* [Operating System Train (2018 Autumn)](http://os.cs.tsinghua.edu.cn/oscourse/OsTrain2018)
6465
* [Operating System (2019 Spring)](http://os.cs.tsinghua.edu.cn/oscourse/OS2019spring/projects)
66+
* [Operating System Train (2019 Autumn)](http://os.cs.tsinghua.edu.cn/oscourse/OsTrain2019)
6567

6668
[Reports](./docs) and [Dev docs](https://rucore.gitbook.io/rust-os-docs/) (in Chinese)
6769

kernel/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export DTB = $(dtb)
8484
qemu_opts := \
8585
-smp cores=$(smp)
8686
qemu_net_opts :=
87-
qemu_ui_opts :=
8887

8988
ifeq ($(arch), x86_64)
9089
qemu_opts += \
@@ -220,12 +219,12 @@ endif
220219
### prefix ###
221220
ifeq ($(arch), x86_64)
222221
ifeq ($(uname), Darwin)
223-
prefix := x86_64-elf-
222+
prefix := x86_64-linux-musl-
224223
endif
225224
else ifeq ($(arch), riscv32)
226-
prefix := riscv64-unknown-elf-
225+
prefix := riscv64-linux-musl-
227226
else ifeq ($(arch), riscv64)
228-
prefix := riscv64-unknown-elf-
227+
prefix := riscv64-linux-musl-
229228
else ifeq ($(arch), mipsel)
230229
prefix ?= mipsel-linux-musln32-
231230
else ifeq ($(arch), aarch64)

rboot

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-06-15
1+
nightly-2019-09-01

0 commit comments

Comments
 (0)