1 Star 2 Fork 1

橘崽崽啊 / myOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

myOS

使用Rust编写的简单操作系统

构建环境

Rust 开发环境配置

首先安装 Rust 版本管理器 rustup 和 Rust 包管理器 cargo:

curl https://sh.rustup.rs -sSf | sh

安装完成后,重新打开一个终端来让之前设置的环境变量生效。

接下来,确认一下正确安装了Rust工具链:

rustc --version

通过如下命令安装 rustcnightly 版本,并把该版本设置为 rustc 的缺省版本。

rustup install nightly
rustup default nightly

换源,如果有必要的话。打开(如果没有就新建) ~/.cargo/config 文件,并把内容修改为:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

安装Rust相关的软件包:

rustup target add riscv64gc-unknown-none-elf
cargo install cargo-binutils --vers =0.3.3
rustup component add llvm-tools-preview
rustup component add rust-src

Qemu 模拟器安装

使用 Qemu 5.0.0 版本安装运行。

安装编译所需的依赖包

安装qemu及其依赖,之后仅卸载qemu保留依赖包,因为需要安装的是qemu5.0.0。

sudo pacman -S qemu
sudo pacman -R qemu

下载源码包

如果下载速度过慢可以使用百度网盘链接:https://pan.baidu.com/s/1z-iWIPjxjxbdFS2Qf-NKxQ 提取码: 8woe

wget https://download.qemu.org/qemu-5.0.0.tar.xz

解压

tar xvJf qemu-5.0.0.tar.xz

编译安装并配置 RISC-V 支持

cd qemu-5.0.0
./configure --target-list=riscv64-softmmu,riscv64-linux-user
make -j$(nproc)
sudo make install

确认 Qemu 的版本:

qemu-system-riscv64 --version
qemu-riscv64 --version

K210 真机串口通信

为了能在 K210 真机上运行 Tutorial,我们还需要安装基于 Python 的串口通信库和简易的串口终端。

pip3 install pyserial
sudo apt install python3-serial

GDB 调试支持

Ubuntu平台下载

运行

python3 __main__.py

开发日志

2022年4月12日

BUG原因:误删user/src/syscall.rs文件

MIT License Copyright (c) 2022 橘崽崽啊 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用Rust编写的简单操作系统 | 操作系统 | rCore | Rust 展开 收起
Rust 等 3 种语言
MIT
取消

发行版 (4)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Rust
1
https://gitee.com/juzaizai/myOS.git
git@gitee.com:juzaizai/myOS.git
juzaizai
myOS
myOS
master

搜索帮助