# shared-scheduler **Repository Path**: ZIP97/shared-scheduler ## Basic Information - **Project Name**: shared-scheduler - **Description**: rCore-N 共享调度器 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-07-02 - **Last Updated**: 2024-07-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # rCore-N 共享调度器 fork ## 如何使用 > 原仓库地址为 ,搭建的流程见我的 [笔记](https://zjp-cn.github.io/os-notes/async-os-dev-log_rCore-N.html)。 但对于本仓库,步骤为 ```shell # 第一步:获取仓库代码,并进入根模块 git clone --recurse-submodules https://gitee.com/ZIP97/shared-scheduler.git cd shared-scheduler # 第二步:执行以下的其中一步 # a. 如果你本地没有 rCore-N 对应的带用户态中断的 qemu 模拟器,则运行安装脚本 sh ./install-qemu5-N-extention.sh # b. 如果你本地已经有上面所说的 qemu 的话,符号链接到根模块 ln -s path/to/qemu-build ./qemu-build # 第三步:详细解释见我的笔记里的第三步“运行 rCore-N” cd ./rCore-N/os/ # 开额外的两个终端,运行 ./rCore-N/sleep.sh 脚本,把显示的 pts 在 just 脚本中进行替换,然后运行 LOG=INFO just run ``` ## 改动记录 rCore-N 文件夹内的代码经过了一些修改,不限于: * 运行 `cargo fmt` 来格式化代码:原来的代码未曾格式化 * 修复 `rustc`/`clippy` 给的建议:它们是代码风格上的,与代码逻辑无关,只是让代码更地道 * 建议多达两三百条吧,运气好的话 `cargo clippy --fix` 会自动修复一些,大部分是手动修复的 * 示例提交:[435529](https://gitee.com/ZIP97/rCore-N/commit/4355298862a6e86b2b84773f0fddb2d22acf6169)、 [a977d8a](https://gitee.com/ZIP97/rCore-N/commit/a977d8a139433bf5b523d3b081448490b8534707) 等等,不一一列举了 * 有些地方 clippy 没给建议,我也可能会改成更地道的 Rust 写法(不改变原代码逻辑),一些示例提交: * [os: exit_current_and_run_next 简化迭代器](https://gitee.com/ZIP97/rCore-N/commit/2479ab6911cb578b99b2cb2e50eb4115b0c935a9) * [os: exit_current_and_run_next 取出而不是克隆 user_trap_handler_task](https://gitee.com/ZIP97/rCore-N/commit/64373e85854231269dcbebba8705cbf44aae0fb2) * [os: UserBuffer::len 利用迭代器简化代码](https://gitee.com/ZIP97/rCore-N/commit/675734d927bf0ccf9148bf8ba5c4308744b0db39) * [os: uart 精简代码](https://gitee.com/ZIP97/rCore-N/commit/686d4978ebe618056296296f5730a06da8b46f69) * [os: 用 core::array::from_fn 替换掉 array-init 库](https://gitee.com/ZIP97/rCore-N/commit/d88e22f9be2d7f2f760fed69d0f1a3c683b03026) * 不一一列举了 * 删除一些 dead code,不限于 * 未曾使用的 nightly features * 未曾使用的 .rs 文件 * 多余的 `#[macro_use]` (实际模块内无任何宏)以及其他多余的属性/宏 ## 其他记录 * 在 os 文件夹内,使用 `cargo doc -F board_qemu` 来生成文档。这是因为某些依赖来自 git,其文档并不在 Rust 官方文档网站上。运行该命令之后,查看 `target/riscv64gc-unknown-none-elf/doc/` 即可。