generated from LearningOS/rust-based-os-comp2023
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main'
- Loading branch information
Showing
49 changed files
with
833 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# syntax=docker/dockerfile:1 | ||
# This Dockerfile is adapted from https://github.com/LearningOS/rCore-Tutorial-v3/blob/main/Dockerfile | ||
# with the following major updates: | ||
# - ubuntu 18.04 -> 20.04 | ||
# - qemu 5.0.0 -> 7.0.0 | ||
# - Extensive comments linking to relevant documentation | ||
FROM ubuntu:20.04 | ||
|
||
ARG QEMU_VERSION=7.0.0 | ||
ARG HOME=/root | ||
|
||
# 0. Install general tools | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
curl \ | ||
git \ | ||
python3 \ | ||
wget | ||
|
||
# 1. Set up QEMU RISC-V | ||
# - https://learningos.github.io/rust-based-os-comp2022/0setup-devel-env.html#qemu | ||
# - https://www.qemu.org/download/ | ||
# - https://wiki.qemu.org/Documentation/Platforms/RISCV | ||
# - https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html | ||
|
||
# 1.1. Download source | ||
WORKDIR ${HOME} | ||
RUN wget https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz && \ | ||
tar xvJf qemu-${QEMU_VERSION}.tar.xz | ||
|
||
# 1.2. Install dependencies | ||
# - https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html#prerequisites | ||
RUN apt-get install -y \ | ||
autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \ | ||
gawk build-essential bison flex texinfo gperf libtool patchutils bc \ | ||
zlib1g-dev libexpat-dev git \ | ||
ninja-build pkg-config libglib2.0-dev libpixman-1-dev | ||
|
||
# 1.3. Build and install from source | ||
WORKDIR ${HOME}/qemu-${QEMU_VERSION} | ||
RUN ./configure --target-list=riscv64-softmmu,riscv64-linux-user && \ | ||
make -j$(nproc) && \ | ||
make install | ||
|
||
# 1.4. Clean up | ||
WORKDIR ${HOME} | ||
RUN rm -rf qemu-${QEMU_VERSION} qemu-${QEMU_VERSION}.tar.xz | ||
|
||
# 1.5. Sanity checking | ||
RUN qemu-system-riscv64 --version && \ | ||
qemu-riscv64 --version | ||
|
||
# 2. Set up Rust | ||
# - https://learningos.github.io/rust-based-os-comp2022/0setup-devel-env.html#qemu | ||
# - https://www.rust-lang.org/tools/install | ||
# - https://github.com/rust-lang/docker-rust/blob/master/Dockerfile-debian.template | ||
|
||
# 2.1. Install | ||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH \ | ||
RUST_VERSION=nightly | ||
RUN set -eux; \ | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init; \ | ||
chmod +x rustup-init; \ | ||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \ | ||
rm rustup-init; \ | ||
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; | ||
|
||
# 2.2. Sanity checking | ||
RUN rustup --version && \ | ||
cargo --version && \ | ||
rustc --version | ||
|
||
# 3. Build env for labs | ||
# See os1/Makefile `env:` for example. | ||
# This avoids having to wait for these steps each time using a new container. | ||
RUN rustup target add riscv64gc-unknown-none-elf && \ | ||
cargo install cargo-binutils --vers ~0.2 && \ | ||
rustup component add rust-src && \ | ||
rustup component add llvm-tools-preview | ||
|
||
# Ready to go | ||
WORKDIR ${HOME} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# 常见问题解答 | ||
|
||
## Q0:GitHub classroom是啥?如何使用? | ||
|
||
### A: | ||
|
||
- [B站的GitHub Classroom 视频介绍](https://www.bilibili.com/video/BV12L41147r7?spm_id_from=333.337.search-card.all.click&vd_source=8e19ee6e49f598fda8c17e306d8b3726) | ||
- [Youtube的GitHub Classroom视频介绍](https://www.youtube.com/playlist?list=PLIRjfNq867bewk3ZGV6Z7a16YDNRCpK3u) | ||
- [github文档:使用 GitHub Classroom 教学](https://docs.github.com/cn/education/manage-coursework-with-github-classroom/get-started-with-github-classroom) | ||
|
||
## Q1:已经在classroom中建立了自己的仓库(例如 “LearningOS/lab0-0-setup-env-run-os1-chyyuu2022"),但是源仓库“LearningOS/rust-based-os-comp2022“更新了,如何处理? | ||
|
||
### A: | ||
|
||
**方法一:** | ||
|
||
重新点击加入课程的链接,在页面下方会有一行字“We've configured the repository associated with this assignment (update)”,“update”是一个链接,点击update就可以把自己的仓库更新到与最新状态的repository template一致。 | ||
|
||
| ||
**方法二:** | ||
|
||
在自己构建的仓库根目录下执行以下命令: | ||
|
||
```makefile | ||
git remote add upstream "https://github.com/LearningOS/rust-based-os-comp2022.git" | ||
git fetch upstream | ||
git checkout -b foo | ||
git branch -D main | ||
git checkout -t upstream/main | ||
git reset --hard origin/main | ||
git push -f | ||
``` | ||
|
||
**方法三:** | ||
|
||
向管理员“助教许善朴”申请删除已生成仓库,再点击 链接重新创建仓库。 | ||
|
||
## Q2:在classroom中建立了自己的仓库中,进行提交 `git push` 后,触发 CI后,出现 Annotations 错误“The job was not stared because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings”,无法完成自动CI功能,比如 `Autograding` 等。 | ||
|
||
### A: | ||
|
||
**方法一:** | ||
|
||
这是由于对用户的私有仓库进行CI 相关的github action是需要付费的。用户可通过给自己的github账户充值来解决。https://docs.github.com/cn/billing/managing-billing-for-github-actions/about-billing-for-github-actions 给出了具体信息。 | ||
|
||
**方法二:** | ||
|
||
对用户的公开仓库进行CI github action是不需要付费的。在项目的 `Settings` -> `Change visibility` 将项目改成Public, 重新触发Action。 | ||
目前设置了让用户具有修改自己的项目从private --> public的能力。 | ||
如果用户还是发现自己的权限不够,或看不到 `Settings` 这个选项,可以通过联系助教帮助来解决。 | ||
|
||
## Q3:我刚开始准备学习Rust,是Rust新手,我应该如何入门? | ||
|
||
### A: | ||
|
||
- [Rust 大佬给初学者的学习建议](https://github.com/rustlang-cn/Rustt/blob/main/Articles/%5B2022-04-02%5D%20Rust%20%E5%A4%A7%E4%BD%AC%E7%BB%99%E5%88%9D%E5%AD%A6%E8%80%85%E7%9A%84%E5%AD%A6%E4%B9%A0%E5%BB%BA%E8%AE%AE.md) | ||
- [张汉东:学习 Rust 你需要一个认知框架](https://zhuanlan.zhihu.com/p/494001676) | ||
- [Rust语言圣经(Rust Course)](https://course.rs/) | ||
- [Rust速查表(cheatsheet)](https://cheats.rs/) 该项目不仅提供了基础的语法速查,还有执行顺序详解和编写时需要关注的注意事项。项目还包含了示例代码(EX)、书籍(BK)、标准(STD)等相关资料的扩展。 | ||
|
||
## Q4:我不熟悉GitHub和Git,有啥快速入门的资源吗? | ||
|
||
### A: | ||
|
||
- [包括:从 0 开始学习 GitHub 系列1-7](https://jtxiao.com/main/categories/%E5%B7%A5%E5%85%B7/) | ||
- [超级简单的Git入门](https://backlog.com/git-tutorial/cn/) | ||
- [git - 简明指南](https://rogerdudler.github.io/git-guide/index.zh.html) | ||
- [中文git-tips](https://github.com/521xueweihan/git-tips) | ||
- [GitHub 官方制作的 Git 速查表](https://education.github.com/git-cheat-sheet-education.pdf) | ||
|
||
## Q5:我不熟悉Linux的各种命令,有啥快速入门的资源吗? | ||
|
||
### A: | ||
|
||
- [中文Linux命令(linux-command)搜索引擎](https://wangchujiang.com/linux-command/):随用随搜Linux命令,而且还支持中文搜索 | ||
- [新版 Linux 命令百科全书》(英文)](https://github.com/tldr-pages/tldr) | ||
|
||
## Q6:我碰到一些命令/应用(比如vim, curl)、操作(比如vscode)或语言用法(比如Makefile)等不知到哪里能快速查找,怎么办? | ||
|
||
### A: | ||
|
||
- [Rico's cheatsheets](https://devhints.io/) 开源、全面的速查表网站,涵盖了前端、后端、运维、IDE 多个方面,而且界面友好简洁支持在线查看 | ||
- [所有与命令行相关的cheatsheet](http://cheat.sh/):号称「你唯一需要的命令行相关速查表」 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.