1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-25 09:26:17 +04:00
rCore/README.md

129 lines
4.3 KiB
Markdown
Raw Normal View History

2019-03-17 21:09:12 +04:00
# rCore
2017-04-11 21:44:44 +04:00
2020-01-29 15:52:18 +04:00
[![CI](https://github.com/rcore-os/rCore/workflows/CI/badge.svg?branch=master)](https://github.com/rcore-os/rCore/actions)
2018-07-06 19:14:51 +04:00
2019-01-05 08:58:11 +04:00
Rust version of THU [uCore OS Plus](https://github.com/chyyuu/ucore_os_plus).
2018-11-19 21:29:44 +04:00
Going to be the next generation teaching operating system.
Supported architectures and boards:
2018-12-02 18:19:32 +04:00
* x86_64: PC (i5/i7)
* RISCV32/64: HiFive Unleashed, Kendryte K210, [FPGA running Rocket Chip](https://github.com/jiegec/fpga-zynq)
* AArch64: Raspberry Pi 3B+
* MIPS32: [TrivialMIPS](https://github.com/Harry-Chen/TrivialMIPS)
2018-07-06 19:14:51 +04:00
2018-12-16 07:47:33 +04:00
![demo](./docs/2_OSLab/os2atc/demo.png)
2017-04-11 21:44:44 +04:00
## Building
2018-08-07 12:48:34 +04:00
### Environment
* [Rust](https://www.rust-lang.org) toolchain
* [QEMU](https://www.qemu.org) >= 4.1.0
2019-10-05 10:38:43 +04:00
* [musl-based GCC toolchains](https://musl.cc/) (only for building [user programs](https://github.com/rcore-os/rcore-user))
2019-02-15 12:10:12 +04:00
2019-10-05 10:38:43 +04:00
Setup on Linux or macOS:
2018-08-07 12:48:34 +04:00
2018-09-19 16:43:49 +04:00
```bash
$ rustup component add rust-src llvm-tools-preview
2019-10-05 10:38:43 +04:00
```
Or use Docker container:
```bash
$ docker run -it -v $PWD:$PWD -w $PWD wangrunji0408/rcore
2018-09-19 16:43:49 +04:00
```
2019-10-05 10:38:43 +04:00
### How to run
2018-08-07 12:48:34 +04:00
```bash
$ git clone https://github.com/rcore-os/rCore.git --recursive
2019-03-20 20:12:33 +04:00
$ cd rCore/user
2020-02-01 09:19:10 +04:00
$ make sfsimg prebuilt=1 arch=x86_64
2019-03-20 20:12:33 +04:00
$ cd ../kernel
2020-02-01 09:19:10 +04:00
$ make run ARCH=x86_64 LOG=info
2018-08-07 12:48:34 +04:00
```
2017-04-11 21:44:44 +04:00
2020-02-01 09:19:10 +04:00
See [Makefile](kernel/Makefile) for more usages.
2019-04-16 09:11:29 +04:00
## Maintainers
| Module | Maintainer |
|--------|-----------------------|
| x86_64 | @wangrunji0408 |
| RISC-V | @jiegec |
2019-04-16 09:11:29 +04:00
| ARM (Raspi3) | @equation314 |
| MIPS | @Harry_Chen @miskcoo |
2019-04-16 09:11:29 +04:00
| Memory, Process, File System | @wangrunji0408 |
| Network with drivers | @jiegec |
| GUI | @equation314 |
## History
This is a project of THU courses:
2019-04-16 09:11:29 +04:00
* [Operating System (2018 Spring) ](http://os.cs.tsinghua.edu.cn/oscourse/OS2018spring/projects/g11)
* [Comprehensive Experiment of Computer System (2018 Summer)](http://os.cs.tsinghua.edu.cn/oscourse/csproject2018/group05)
* [Operating System Train (2018 Autumn)](http://os.cs.tsinghua.edu.cn/oscourse/OsTrain2018)
* [Operating System (2019 Spring)](http://os.cs.tsinghua.edu.cn/oscourse/OS2019spring/projects)
* [Operating System Train (2019 Autumn)](http://os.cs.tsinghua.edu.cn/oscourse/OsTrain2019)
2019-04-16 09:11:29 +04:00
[Reports](./docs) and [Dev docs](https://rucore.gitbook.io/rust-os-docs/) (in Chinese)
It's based on [BlogOS](https://github.com/phil-opp/blog_os) , a demo project in the excellent tutorial [Writing an OS in Rust (First Edition)](https://os.phil-opp.com/first-edition/).
2017-04-11 21:44:44 +04:00
## License
2018-04-02 11:28:32 +04:00
2017-04-11 21:44:44 +04:00
The source code is dual-licensed under MIT or the Apache License (Version 2.0).
2020-05-25 04:47:25 +04:00
## libc-test
### 安装
2020-05-26 12:41:27 +04:00
直接使用我们的 `user` 子模块即可。如果要自己设置,在 `user` 目录下执行
2020-05-25 04:47:25 +04:00
```bash
$ git clone git://repo.or.cz/libc-test
2020-05-26 12:41:27 +04:00
$ rm -r libc-test/.git
2020-05-25 04:47:25 +04:00
```
### 编译
2020-05-26 12:41:27 +04:00
考虑到在 rCore 中编译所有测例耗费时间过长,所以选择在本机用 musl-gcc 编译。请确保自己已经安装好了`x86_64-linux-musl-gcc` 工具链,且在 path 中,在 `config.make` 制定了 `CC` 的值。
在本机执行:
2020-05-25 04:47:25 +04:00
```bash
$ make
$ rm src/*/*.err
```
2020-05-26 12:41:27 +04:00
随后修改 `user` 目录下的 `Makefile` 文件,将 `libc-test`打包进入文件系统。
2020-05-25 04:47:25 +04:00
### 在 rCore 中测试
2020-05-26 12:41:27 +04:00
进入 `libc-test` 目录,执行脚本
2020-05-25 04:47:25 +04:00
```bash
$ ash runtest.sh
```
在测试测例前控制台会先打印当前测例名。若测试成功则顺次测试下一个测例,若失败则会打印额外信息,当遇到更严重的错误时可能导致 rCore 卡死或崩溃。例如在测试 `math` 库中的 `sqrt` 时,若测试失败,则输出为
```
run sqrt
sqrt failed
```
在结束后,可前往对应测例所在目录下,通过查看测例所对应的 `.err` 文件查看失败的原因。
2020-05-26 12:41:27 +04:00
当遇到使得 rCore 崩溃的测例时,手动记录当前测例在 `runtest.sh` 中的位置,手动更新 `user` 中的文件,使其从下一个测例开始测试,并记录中间若干测例的测试结果。如此反复,直到测试过所有测例。
2020-05-25 04:47:25 +04:00
### 目前测试的结果
- [ ] 尚未通过的测例 (215/473)
- [ ] `pthread` 相关:可能由于缺少相关信号
- [ ] `math` 相关:由于缺少对 `mxcsr` 寄存器的支持,导致获取 `FP Exceptions` 失败,从而无法通过相关测例中对 `FP Exceptions` 的校验。极少数情况出现对于 bad cases 的计算错误。
- [ ] `sync` 相关
具体的测试结果可参考 `user/libc-test/` 目录下的三个 `RECORD.txt` 文件。