mirror of
https://github.com/LearningOS/rust-based-os-comp2022.git
synced 2026-05-11 10:33:37 +08:00
11
Makefile
11
Makefile
@@ -2,7 +2,6 @@ DOCKER_NAME ?= rust-os-camp-2022
|
|||||||
DIR := workplace
|
DIR := workplace
|
||||||
.PHONY: docker build_docker
|
.PHONY: docker build_docker
|
||||||
|
|
||||||
|
|
||||||
test: test3 test4 test5 test6 test7 test8
|
test: test3 test4 test5 test6 test7 test8
|
||||||
|
|
||||||
lab1: test3
|
lab1: test3
|
||||||
@@ -23,7 +22,7 @@ setup:
|
|||||||
cp -r ci-user ${DIR}
|
cp -r ci-user ${DIR}
|
||||||
cp -r bootloader ${DIR}
|
cp -r bootloader ${DIR}
|
||||||
cp -r reports ${DIR}
|
cp -r reports ${DIR}
|
||||||
cp rust-toolchain ${DIR}
|
cp rust-toolchain.toml ${DIR}
|
||||||
# export PATH=${PATH}:${HOME}/qemu-7.0.0:${HOME}/qemu-7.0.0/riscv64-softmmu
|
# export PATH=${PATH}:${HOME}/qemu-7.0.0:${HOME}/qemu-7.0.0/riscv64-softmmu
|
||||||
|
|
||||||
test1: setup
|
test1: setup
|
||||||
@@ -65,7 +64,7 @@ clean:
|
|||||||
docker:
|
docker:
|
||||||
docker run --rm -it -v ${PWD}:/mnt -w /mnt ${DOCKER_NAME} bash
|
docker run --rm -it -v ${PWD}:/mnt -w /mnt ${DOCKER_NAME} bash
|
||||||
|
|
||||||
build_docker:
|
build_docker:
|
||||||
docker build -t ${DOCKER_NAME} .
|
docker build -t ${DOCKER_NAME} .
|
||||||
|
|
||||||
setupclassroom_test1:
|
setupclassroom_test1:
|
||||||
@@ -164,7 +163,7 @@ setupclassroom_test8:
|
|||||||
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
|
git commit -m"update classroom.yml .keep autograding.json for classroom CI test"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
# for local ubuntu with zsh shell SHELL, need root for sudo
|
# for local ubuntu with zsh shell SHELL, need root for sudo
|
||||||
ubuntu_local_setenv:
|
ubuntu_local_setenv:
|
||||||
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
|
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
|
||||||
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
|
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
|
||||||
@@ -181,7 +180,7 @@ ubuntu_local_setenv:
|
|||||||
rustc --version
|
rustc --version
|
||||||
|
|
||||||
# for github codespaces ubuntu with zsh SHELL, need root for sudo
|
# for github codespaces ubuntu with zsh SHELL, need root for sudo
|
||||||
codespaces_setenv:
|
codespaces_setenv:
|
||||||
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
|
sudo apt install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev \
|
||||||
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
|
gawk build-essential bison flex texinfo gperf libtool patchutils bc \
|
||||||
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 ninja-build zsh -y
|
zlib1g-dev libexpat-dev pkg-config libglib2.0-dev libpixman-1-dev git tmux python3 ninja-build zsh -y
|
||||||
@@ -194,4 +193,4 @@ codespaces_setenv:
|
|||||||
qemu-riscv64 --version
|
qemu-riscv64 --version
|
||||||
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
/bin/zsh && source /home/codespace/.cargo/env
|
/bin/zsh && source /home/codespace/.cargo/env
|
||||||
rustc --version
|
rustc --version
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
基于github classroom的开发方式
|
基于github classroom的开发方式
|
||||||
|
|
||||||
基于github classroom,可方便建立开发用的git repository,并可基于github的 codespace (在线版ubuntu +vscode)在线开发使用。整个开发环境仅仅需要一个网络浏览器。
|
基于github classroom,可方便建立开发用的git repository,并可基于github的 codespace (在线版ubuntu +vscode)在线开发使用。整个开发环境仅仅需要一个网络浏览器。
|
||||||
|
|
||||||
1. 在网络浏览器中用自己的 github id 登录 github.com
|
1. 在网络浏览器中用自己的 github id 登录 github.com
|
||||||
@@ -62,15 +62,15 @@
|
|||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git clone ``gitaddr of github-classroom-build-lab0-0``
|
$ git clone ``gitaddr of github-classroom-build-lab0-0``
|
||||||
$ cd ``github-classroom-build-lab0-0``
|
$ cd ``github-classroom-build-lab0-0``
|
||||||
$ make setupclassroom_test1 //注意:这一步很重要,是用于github classroom自动评测你的工作。这一步只需在首次克隆项目仓库时执行一次,以后一般就不用执行了,除非 .github/workflows/classroom.yml发生了变化。
|
$ make setupclassroom_test1 //注意:这一步很重要,是用于github classroom自动评测你的工作。这一步只需在首次克隆项目仓库时执行一次,以后一般就不用执行了,除非 .github/workflows/classroom.yml发生了变化。
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
实验名称 :实验编号
|
实验名称 :实验编号
|
||||||
|
|
||||||
- lab0-0 : test1
|
- lab0-0 : test1
|
||||||
- lab0-1:test2
|
- lab0-1:test2
|
||||||
- lab1:test3
|
- lab1:test3
|
||||||
- lab2:test4
|
- lab2:test4
|
||||||
- lab3:test5
|
- lab3:test5
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
│ ├── logging.rs (为本项目实现了日志功能)
|
│ ├── logging.rs (为本项目实现了日志功能)
|
||||||
│ ├── main.rs (内核主函数)
|
│ ├── main.rs (内核主函数)
|
||||||
│ └── sbi.rs (封装底层 SBI 实现提供的 SBI 接口)
|
│ └── sbi.rs (封装底层 SBI 实现提供的 SBI 接口)
|
||||||
└── rust-toolchain (整个项目的工具链版本)
|
└── rust-toolchain.toml (整个项目的工具链版本)
|
||||||
|
|
||||||
cloc os
|
cloc os
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@@ -123,4 +123,4 @@
|
|||||||
TOML 1 2 1 7
|
TOML 1 2 1 7
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
SUM: 8 39 11 207
|
SUM: 8 39 11 207
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
基于github classroom的开发方式
|
基于github classroom的开发方式
|
||||||
|
|
||||||
基于github classroom,可方便建立开发用的git repository,并可基于github的 codespace (在线版ubuntu +vscode)在线开发使用。整个开发环境仅仅需要一个网络浏览器。
|
基于github classroom,可方便建立开发用的git repository,并可基于github的 codespace (在线版ubuntu +vscode)在线开发使用。整个开发环境仅仅需要一个网络浏览器。
|
||||||
|
|
||||||
1. 在网络浏览器中用自己的 github id 登录 github.com
|
1. 在网络浏览器中用自己的 github id 登录 github.com
|
||||||
@@ -101,27 +101,27 @@
|
|||||||
上述的3,4,5步不是必须的,你也可以线下本地开发。
|
上述的3,4,5步不是必须的,你也可以线下本地开发。
|
||||||
|
|
||||||
注:如果是本地的ubuntu中建立开发环境,可在shell中执行 ``make ubuntu_local_setenv`` 来自动安装配置开发环境(执行``sudo``需要root权限,仅需要执行一次)。
|
注:如果是本地的ubuntu中建立开发环境,可在shell中执行 ``make ubuntu_local_setenv`` 来自动安装配置开发环境(执行``sudo``需要root权限,仅需要执行一次)。
|
||||||
|
|
||||||
获取本章代码:
|
获取本章代码:
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
|
|
||||||
$ git clone ``gitaddr of github-classroom-build-lab5``
|
$ git clone ``gitaddr of github-classroom-build-lab5``
|
||||||
$ cd ``github-classroom-build-lab5``
|
$ cd ``github-classroom-build-lab5``
|
||||||
$ make setupclassroom_test8 //注意:这一步很重要,是用于github classroom自动评测你的工作。这一步只需在首次克隆项目仓库时执行一次,以后一般就不用执行了,除非 .github/workflows/classroom.yml发生了变化。
|
$ make setupclassroom_test8 //注意:这一步很重要,是用于github classroom自动评测你的工作。这一步只需在首次克隆项目仓库时执行一次,以后一般就不用执行了,除非 .github/workflows/classroom.yml发生了变化。
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
实验名称 :实验编号
|
实验名称 :实验编号
|
||||||
|
|
||||||
- lab0-0 : test1
|
- lab0-0 : test1
|
||||||
- lab0-1:test2
|
- lab0-1:test2
|
||||||
- lab1:test3
|
- lab1:test3
|
||||||
- lab2:test4
|
- lab2:test4
|
||||||
- lab3:test5
|
- lab3:test5
|
||||||
- lab4:test6
|
- lab4:test6
|
||||||
- lab5:test8
|
- lab5:test8
|
||||||
|
|
||||||
在 qemu 模拟器上运行本章代码 `lab5(os8)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref>`_ :
|
在 qemu 模拟器上运行本章代码 `lab5(os8)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref>`_ :
|
||||||
|
|
||||||
.. code-block:: console
|
.. code-block:: console
|
||||||
@@ -263,4 +263,4 @@
|
|||||||
│ ├── mod.rs (修改:使用线程对应的中断上下文地址而非固定的 TRAP_CONTEXT)
|
│ ├── mod.rs (修改:使用线程对应的中断上下文地址而非固定的 TRAP_CONTEXT)
|
||||||
│ └── trap.S
|
│ └── trap.S
|
||||||
├── README.md
|
├── README.md
|
||||||
└── rust-toolchain
|
└── rust-toolchain.toml
|
||||||
|
|||||||
Reference in New Issue
Block a user