This commit is contained in:
chyyuu
2022-07-03 02:51:00 +00:00
parent ec4cdc784d
commit c8083d96d2
11 changed files with 441 additions and 12 deletions

View File

@@ -60,7 +60,9 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
├── ...
- 通过所有测例:
- 开发并通过所有测例:
在 ``YOUR_LAB1_REPO_DIR`` 下进行编码(可学习参考 ``os3-ref/src`` 目录下的源代码,并在 ``os3/src`` 中完成编码),并进行编译测试。
CI 使用的测例与本地相同测试中user 文件夹及其它与构建相关的文件将被替换,请不要试图依靠硬编码通过测试。
@@ -68,14 +70,14 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
你需要在编译时指定 ``BASE=0`` 控制框架仅编译实验测例(在 os 目录执行 ``make run BASE=0``
或指定 ``BASE=2`` 控制框架同时编译基础测例和实验测例。
.. note::
**测试方式**
你的实现只需且必须通过测例,建议读者感到困惑时先检查测例
如果实现正确,可在项目仓库的根目录下执行 ``make test3`` ,应该看到显示输出:
如果实现正确,可在项目仓库的根目录下执行 ``make test3`` ,应该看到类似如下的显示输出:
.. code-block:: console

View File

@@ -66,6 +66,68 @@ tips:
TIPS注意 port 参数的语义,它与内核定义的 MapPermission 有明显不同!
- 开发并通过所有测例
在 ``YOUR_LAB2_REPO_DIR`` 下进行编码(可学习参考 ``os4-ref/src`` 目录下的源代码,并在 ``os4/src`` 中完成编码),并进行编译测试。
.. note::
**测试方式**
你的实现只需且必须通过测例,建议读者感到困惑时先检查测例
如果实现正确,可在项目仓库的根目录下执行 ``make test4`` ,应该看到类似如下的显示输出:
.. code-block:: console
$ cd YOUR_LAB2_REPO_DIR
$ make test4
......
[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0
.______ __ __ _______.___________. _______..______ __
| _ \ | | | | / | | / || _ \ | |
| |_) | | | | | | (----`---| |----`| (----`| |_) || |
| / | | | | \ \ | | \ \ | _ < | |
| |\ \----.| `--' |.----) | | | .----) | | |_) || |
| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|
[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1
[rustsbi] Platform Name : riscv-virtio,qemu
[rustsbi] Platform SMP : 1
[rustsbi] Platform Memory : 0x80000000..0x88000000
[rustsbi] Boot HART : 0
[rustsbi] Device Tree Region : 0x87000000..0x87000ef2
[rustsbi] Firmware Address : 0x80000000
[rustsbi] Supervisor Address : 0x80200000
[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
[rustsbi] pmp02: 0x80000000..0x80200000 (---)
[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
......
[PASS] found <Hello, world from user mode program!>
[PASS] found <Test power_3 OK29777!>
[PASS] found <Test power_5 OK29777!>
[PASS] found <Test power_7 OK29777!>
[PASS] found <get_time OK29777! (\d+)>
[PASS] found <Test sleep OK29777!>
[PASS] found <current time_msec = (\d+)>
[PASS] found <time_msec = (\d+) after sleeping (\d+) ticks, delta = (\d+)ms!>
[PASS] found <Test sleep1 passed29777!>
[PASS] found <Test write A OK29777!>
[PASS] found <Test write B OK29777!>
[PASS] found <Test write C OK29777!>
[PASS] found <string from task info test>
[PASS] found <Test task info OK29777!>
[PASS] found <Test 04_1 OK29777!>
[PASS] found <Test 04_4 test OK29777!>
[PASS] found <Test 04_5 ummap OK29777!>
[PASS] found <Test 04_6 ummap2 OK29777!>
[PASS] not found <FAIL: T.T>
[PASS] not found <Should cause error, Test 04_2 fail!>
[PASS] not found <Should cause error, Test 04_3 fail!>
Test passed29777: 21/21
Report for lab1 found.
Report for lab2 found.
- 提交你的修改
- 如果是基于GitHub Classroom 开发, 在本地环境或在线codespaces环境下执行 ``git push`` 命令提交修改的代码到gitub进行CI自动评测。如果评测结果是 红色小叉 位于repo的中上位置可进一步点击红色小叉查找具体出错时的CI执行情况。

View File

@@ -87,9 +87,60 @@ BigStride 表示一个预先定义的大常数,则该调度方案为每个进
从本章开始,你的内核必须前向兼容,能通过前一章的所有测例。
- 开发并通过所有测例
在 ``YOUR_LAB3_REPO_DIR`` 下进行编码(可学习参考 ``os5-ref/src`` 目录下的源代码,并在 ``os5/src`` 中完成编码),并进行编译测试。
.. note::
利用 ``git cherry-pick`` 系列指令,能方便地将前一章分支 commit 移植到本章分支。
**测试方式**
你的实现只需且必须通过测例,建议读者感到困惑时先检查测例
如果实现正确,可在项目仓库的根目录下执行 ``make test5`` ,应该看到类似如下的显示输出:
.. code-block:: console
$ cd YOUR_LAB3_REPO_DIR
$ make test5
......
[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0
.______ __ __ _______.___________. _______..______ __
| _ \ | | | | / | | / || _ \ | |
| |_) | | | | | | (----`---| |----`| (----`| |_) || |
| / | | | | \ \ | | \ \ | _ < | |
| |\ \----.| `--' |.----) | | | .----) | | |_) || |
| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|
[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1
[rustsbi] Platform Name : riscv-virtio,qemu
[rustsbi] Platform SMP : 1
[rustsbi] Platform Memory : 0x80000000..0x88000000
[rustsbi] Boot HART : 0
[rustsbi] Device Tree Region : 0x87000000..0x87000ef2
[rustsbi] Firmware Address : 0x80000000
[rustsbi] Supervisor Address : 0x80200000
[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
[rustsbi] pmp02: 0x80000000..0x80200000 (---)
[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
......
[PASS] found <current time_msec = (\d+)>
[PASS] found <Test wait OK42266!>
[PASS] found <time_msec = (\d+) after sleeping (\d+) ticks, delta = (\d+)ms!>
[PASS] found <Test 04_4 test OK42266!>
[PASS] found <Test 04_6 ummap2 OK42266!>
......
[PASS] found <Test set_priority OK42266!>
[PASS] found <Test write B OK42266!>
[PASS] not found <FAIL: T.T>
[PASS] not found <Should cause error, Test 04_2 fail!>
[PASS] not found <Should cause error, Test 04_3 fail!>
Test passed42266: 24/24
stride ratio = [15202320, 13745266, 13849200, 12149100, 10944222, 9782240]
[PASS] Stride Test
Test passed42266: 1/1
- 提交你的修改

View File

@@ -102,6 +102,59 @@ Lab4 编程作业
你也可以完全在用户态进行调试。仿照 ``easy-fs-fuse`` 建立一个在当前操作系统中运行的应用程序,将测试逻辑写在 ``main`` 函数中。这个时候就可以将它引用的 ``easy-fs`` 的 ``no_std`` 去掉并使用 ``println!`` 进行调试。
- 开发并通过所有测例
在 ``YOUR_LAB4_REPO_DIR`` 下进行编码(可学习参考 ``os6-ref/src`` 目录下的源代码,并在 ``os6/src`` 中完成编码),并进行编译测试。
注意:本次实验需要扩展文件系统的功能,所以,除了需要修改扩展 ``os6`` 目录下的代码外,还需要修改扩展 ``easy-fs`` 和 ``easy-fs-fuse`` 下面的部分代码。
.. note::
**测试方式**
你的实现只需且必须通过测例,建议读者感到困惑时先检查测例
如果实现正确,可在项目仓库的根目录下执行 ``make test6`` ,应该看到类似如下的显示输出:
.. code-block:: console
$ cd YOUR_LAB4_REPO_DIR
$ make test6
......
[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0
.______ __ __ _______.___________. _______..______ __
| _ \ | | | | / | | / || _ \ | |
| |_) | | | | | | (----`---| |----`| (----`| |_) || |
| / | | | | \ \ | | \ \ | _ < | |
| |\ \----.| `--' |.----) | | | .----) | | |_) || |
| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|
[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1
[rustsbi] Platform Name : riscv-virtio,qemu
[rustsbi] Platform SMP : 1
[rustsbi] Platform Memory : 0x80000000..0x88000000
[rustsbi] Boot HART : 0
[rustsbi] Device Tree Region : 0x87000000..0x87000ef2
[rustsbi] Firmware Address : 0x80000000
[rustsbi] Supervisor Address : 0x80200000
[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
[rustsbi] pmp02: 0x80000000..0x80200000 (---)
[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
......
[PASS] found <Test 04_5 ummap OK53852!>
[PASS] found <Test 04_1 OK53852!>
.....
[PASS] found <Test write C OK53852!>
[PASS] found <get_time OK53852! (\d+)>
[PASS] not found <FAIL: T.T>
[PASS] not found <Should cause error, Test 04_2 fail!>
[PASS] not found <Should cause error, Test 04_3 fail!>
Test passed53852: 27/27
Report for lab1 found.
Report for lab2 found.
Report for lab3 found.
Report for lab4 found.
- 提交你的修改
- 如果是基于GitHub Classroom 开发, 在本地环境或在线codespaces环境下执行 ``git push`` 命令提交修改的代码到gitub进行CI自动评测。如果评测结果是 红色小叉 位于repo的中上位置可进一步点击红色小叉查找具体出错时的CI执行情况。

View File

@@ -87,7 +87,61 @@ Lab5 编程作业
- `lab5(os8)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref>`_
- 实验目录在 ``os8`` 。
- 通过所有测例
- 开发并通过所有测例
在 ``YOUR_LAB5_REPO_DIR`` 下进行编码(可学习参考 ``os8-ref/src`` 目录下的源代码,并在 ``os8/src`` 中完成编码),并进行编译测试。
.. note::
**测试方式**
你的实现只需且必须通过测例,建议读者感到困惑时先检查测例
如果实现正确,可在项目仓库的根目录下执行 ``make test8`` ,应该看到类似如下的显示输出:
.. code-block:: console
$ cd YOUR_LAB5_REPO_DIR
$ make test8
......
[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0
.______ __ __ _______.___________. _______..______ __
| _ \ | | | | / | | / || _ \ | |
| |_) | | | | | | (----`---| |----`| (----`| |_) || |
| / | | | | \ \ | | \ \ | _ < | |
| |\ \----.| `--' |.----) | | | .----) | | |_) || |
| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|
[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1
[rustsbi] Platform Name : riscv-virtio,qemu
[rustsbi] Platform SMP : 1
[rustsbi] Platform Memory : 0x80000000..0x88000000
[rustsbi] Boot HART : 0
[rustsbi] Device Tree Region : 0x87000000..0x87000ef2
[rustsbi] Firmware Address : 0x80000000
[rustsbi] Supervisor Address : 0x80200000
[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
[rustsbi] pmp02: 0x80000000..0x80200000 (---)
[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
......
[PASS] found <Hello, world from user mode program!>
[PASS] found <Test power_3 OK60963!>
[PASS] found <Test power_5 OK60963!>
......
[PASS] found <threads test passed60963!>
[PASS] found <deadlock test mutex 1 OK60963!>
[PASS] found <deadlock test semaphore 1 OK60963!>
[PASS] found <deadlock test semaphore 2 OK60963!>
[PASS] found <ch8 Usertests passed60963!>
[PASS] not found <FAIL: T.T>
[PASS] not found <Should cause error, Test 04_2 fail!>
[PASS] not found <Should cause error, Test 04_3 fail!>
Test passed60963: 29/29
Report for lab1 found.
Report for lab2 found.
Report for lab3 found.
Report for lab4 found.
Report for lab5 found.
- 提交你的修改

View File

@@ -359,9 +359,10 @@
</pre></div>
</div>
<ul>
<li><p>通过所有测例:</p>
<li><p>开发并通过所有测例:</p>
<blockquote>
<div><p>CI 使用的测例与本地相同测试中user 文件夹及其它与构建相关的文件将被替换,请不要试图依靠硬编码通过测试。</p>
<div><p><code class="docutils literal notranslate"><span class="pre">YOUR_LAB1_REPO_DIR</span></code> 下进行编码(可学习参考 <code class="docutils literal notranslate"><span class="pre">os3-ref/src</span></code> 目录下的源代码,并在 <code class="docutils literal notranslate"><span class="pre">os3/src</span></code> 中完成编码),并进行编译测试。</p>
<p>CI 使用的测例与本地相同测试中user 文件夹及其它与构建相关的文件将被替换,请不要试图依靠硬编码通过测试。</p>
<p><code class="docutils literal notranslate"><span class="pre">os3</span></code> 目录下默认情况下makefile 仅编译基础测例 (<code class="docutils literal notranslate"><span class="pre">BASE=1</span></code>),即无需修改框架即可正常运行的测例。
你需要在编译时指定 <code class="docutils literal notranslate"><span class="pre">BASE=0</span></code> 控制框架仅编译实验测例(在 os 目录执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span> <span class="pre">BASE=0</span></code>
或指定 <code class="docutils literal notranslate"><span class="pre">BASE=2</span></code> 控制框架同时编译基础测例和实验测例。</p>
@@ -372,7 +373,7 @@
<p class="admonition-title">注解</p>
<p><strong>测试方式</strong></p>
<p>你的实现只需且必须通过测例,建议读者感到困惑时先检查测例</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test3</span></code> ,应该看到显示输出:</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test3</span></code> ,应该看到类似如下的显示输出:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span> YOUR_LAB1_DIR
<span class="gp">$ </span>make test3
<span class="go">......</span>

View File

@@ -373,6 +373,65 @@
<li><p>报告命名 lab2.md位于 <code class="docutils literal notranslate"><span class="pre">reports</span></code> 目录下</p></li>
</ul>
<p>TIPS注意 port 参数的语义,它与内核定义的 MapPermission 有明显不同!</p>
<ul class="simple">
<li><p>开发并通过所有测例</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">YOUR_LAB2_REPO_DIR</span></code> 下进行编码(可学习参考 <code class="docutils literal notranslate"><span class="pre">os4-ref/src</span></code> 目录下的源代码,并在 <code class="docutils literal notranslate"><span class="pre">os4/src</span></code> 中完成编码),并进行编译测试。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p><strong>测试方式</strong></p>
<p>你的实现只需且必须通过测例,建议读者感到困惑时先检查测例</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test4</span></code> ,应该看到类似如下的显示输出:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span> YOUR_LAB2_REPO_DIR
<span class="gp">$ </span>make test4
<span class="go">......</span>
<span class="go">[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0</span>
<span class="go">.______ __ __ _______.___________. _______..______ __</span>
<span class="go">| _ \ | | | | / | | / || _ \ | |</span>
<span class="go">| |_) | | | | | | (----`---| |----`| (----`| |_) || |</span>
<span class="go">| / | | | | \ \ | | \ \ | _ &lt; | |</span>
<span class="go">| |\ \----.| `--' |.----) | | | .----) | | |_) || |</span>
<span class="go">| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|</span>
<span class="go">[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1</span>
<span class="go">[rustsbi] Platform Name : riscv-virtio,qemu</span>
<span class="go">[rustsbi] Platform SMP : 1</span>
<span class="go">[rustsbi] Platform Memory : 0x80000000..0x88000000</span>
<span class="go">[rustsbi] Boot HART : 0</span>
<span class="go">[rustsbi] Device Tree Region : 0x87000000..0x87000ef2</span>
<span class="go">[rustsbi] Firmware Address : 0x80000000</span>
<span class="go">[rustsbi] Supervisor Address : 0x80200000</span>
<span class="go">[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)</span>
<span class="go">[rustsbi] pmp02: 0x80000000..0x80200000 (---)</span>
<span class="go">[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)</span>
<span class="go">......</span>
<span class="go">[PASS] found &lt;Hello, world from user mode program!&gt;</span>
<span class="go">[PASS] found &lt;Test power_3 OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test power_5 OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test power_7 OK29777!&gt;</span>
<span class="go">[PASS] found &lt;get_time OK29777! (\d+)&gt;</span>
<span class="go">[PASS] found &lt;Test sleep OK29777!&gt;</span>
<span class="go">[PASS] found &lt;current time_msec = (\d+)&gt;</span>
<span class="go">[PASS] found &lt;time_msec = (\d+) after sleeping (\d+) ticks, delta = (\d+)ms!&gt;</span>
<span class="go">[PASS] found &lt;Test sleep1 passed29777!&gt;</span>
<span class="go">[PASS] found &lt;Test write A OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test write B OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test write C OK29777!&gt;</span>
<span class="go">[PASS] found &lt;string from task info test&gt;</span>
<span class="go">[PASS] found &lt;Test task info OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test 04_1 OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test 04_4 test OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test 04_5 ummap OK29777!&gt;</span>
<span class="go">[PASS] found &lt;Test 04_6 ummap2 OK29777!&gt;</span>
<span class="go">[PASS] not found &lt;FAIL: T.T&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_2 fail!&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_3 fail!&gt;</span>
<span class="go">Test passed29777: 21/21</span>
<span class="go">Report for lab1 found.</span>
<span class="go">Report for lab2 found.</span>
</pre></div>
</div>
</div>
<ul>
<li><p>提交你的修改</p>
<blockquote>

View File

@@ -368,10 +368,56 @@ BigStride 表示一个预先定义的大常数,则该调度方案为每个进
<p>CI 的原理是用 <code class="docutils literal notranslate"><span class="pre">ch5_usertest</span></code> 替代 <code class="docutils literal notranslate"><span class="pre">ch5b_initproc</span></code> ,使内核在所有测例执行完后直接退出。</p>
<p>从本章开始,你的内核必须前向兼容,能通过前一章的所有测例。</p>
</li>
<li><p>开发并通过所有测例</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">YOUR_LAB3_REPO_DIR</span></code> 下进行编码(可学习参考 <code class="docutils literal notranslate"><span class="pre">os5-ref/src</span></code> 目录下的源代码,并在 <code class="docutils literal notranslate"><span class="pre">os5/src</span></code> 中完成编码),并进行编译测试。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>利用 <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">cherry-pick</span></code> 系列指令,能方便地将前一章分支 commit 移植到本章分支。</p>
<p><strong>测试方式</strong></p>
<p>你的实现只需且必须通过测例,建议读者感到困惑时先检查测例</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test5</span></code> ,应该看到类似如下的显示输出:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"> $ </span><span class="nb">cd</span> YOUR_LAB3_REPO_DIR
<span class="gp"> $ </span>make test5
<span class="go"> ......</span>
<span class="go"> [rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0</span>
<span class="go"> .______ __ __ _______.___________. _______..______ __</span>
<span class="go"> | _ \ | | | | / | | / || _ \ | |</span>
<span class="go"> | |_) | | | | | | (----`---| |----`| (----`| |_) || |</span>
<span class="go"> | / | | | | \ \ | | \ \ | _ &lt; | |</span>
<span class="go"> | |\ \----.| `--' |.----) | | | .----) | | |_) || |</span>
<span class="go"> | _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|</span>
<span class="go"> [rustsbi] Implementation : RustSBI-QEMU Version 0.1.1</span>
<span class="go"> [rustsbi] Platform Name : riscv-virtio,qemu</span>
<span class="go"> [rustsbi] Platform SMP : 1</span>
<span class="go"> [rustsbi] Platform Memory : 0x80000000..0x88000000</span>
<span class="go"> [rustsbi] Boot HART : 0</span>
<span class="go"> [rustsbi] Device Tree Region : 0x87000000..0x87000ef2</span>
<span class="go"> [rustsbi] Firmware Address : 0x80000000</span>
<span class="go"> [rustsbi] Supervisor Address : 0x80200000</span>
<span class="go"> [rustsbi] pmp01: 0x00000000..0x80000000 (-wr)</span>
<span class="go"> [rustsbi] pmp02: 0x80000000..0x80200000 (---)</span>
<span class="go"> [rustsbi] pmp03: 0x80200000..0x88000000 (xwr)</span>
<span class="go"> ......</span>
<span class="go"> [PASS] found &lt;current time_msec = (\d+)&gt;</span>
<span class="go"> [PASS] found &lt;Test wait OK42266!&gt;</span>
<span class="go"> [PASS] found &lt;time_msec = (\d+) after sleeping (\d+) ticks, delta = (\d+)ms!&gt;</span>
<span class="go"> [PASS] found &lt;Test 04_4 test OK42266!&gt;</span>
<span class="go"> [PASS] found &lt;Test 04_6 ummap2 OK42266!&gt;</span>
<span class="go">......</span>
<span class="go"> [PASS] found &lt;Test set_priority OK42266!&gt;</span>
<span class="go"> [PASS] found &lt;Test write B OK42266!&gt;</span>
<span class="go"> [PASS] not found &lt;FAIL: T.T&gt;</span>
<span class="go"> [PASS] not found &lt;Should cause error, Test 04_2 fail!&gt;</span>
<span class="go"> [PASS] not found &lt;Should cause error, Test 04_3 fail!&gt;</span>
<span class="go"> Test passed42266: 24/24</span>
<span class="go"> stride ratio = [15202320, 13745266, 13849200, 12149100, 10944222, 9782240]</span>
<span class="go"> [PASS] Stride Test</span>
<span class="go"> Test passed42266: 1/1</span>
</pre></div>
</div>
</div>
<ul>
<li><p>提交你的修改</p>

View File

@@ -424,6 +424,55 @@
<p>如果你在第一章练习题中已经借助 <code class="docutils literal notranslate"><span class="pre">log</span></code> crate 实现了日志功能,那么你可以直接在 <code class="docutils literal notranslate"><span class="pre">easy-fs</span></code> 中引入 <code class="docutils literal notranslate"><span class="pre">log</span></code> crate通过 <code class="docutils literal notranslate"><span class="pre">log::info!/debug!</span></code> 等宏即可进行调试并在内核中看到日志输出。具体来说,在 <code class="docutils literal notranslate"><span class="pre">easy-fs</span></code> 中的修改是:在 <code class="docutils literal notranslate"><span class="pre">easy-fs/Cargo.toml</span></code> 的依赖中加入一行 <code class="docutils literal notranslate"><span class="pre">log</span> <span class="pre">=</span> <span class="pre">"0.4.0"</span></code>,然后在 <code class="docutils literal notranslate"><span class="pre">easy-fs/src/lib.rs</span></code> 中加入一行 <code class="docutils literal notranslate"><span class="pre">extern</span> <span class="pre">crate</span> <span class="pre">log</span></code></p>
<p>你也可以完全在用户态进行调试。仿照 <code class="docutils literal notranslate"><span class="pre">easy-fs-fuse</span></code> 建立一个在当前操作系统中运行的应用程序,将测试逻辑写在 <code class="docutils literal notranslate"><span class="pre">main</span></code> 函数中。这个时候就可以将它引用的 <code class="docutils literal notranslate"><span class="pre">easy-fs</span></code><code class="docutils literal notranslate"><span class="pre">no_std</span></code> 去掉并使用 <code class="docutils literal notranslate"><span class="pre">println!</span></code> 进行调试。</p>
</div>
<ul class="simple">
<li><p>开发并通过所有测例</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">YOUR_LAB4_REPO_DIR</span></code> 下进行编码(可学习参考 <code class="docutils literal notranslate"><span class="pre">os6-ref/src</span></code> 目录下的源代码,并在 <code class="docutils literal notranslate"><span class="pre">os6/src</span></code> 中完成编码),并进行编译测试。</p>
<p>注意:本次实验需要扩展文件系统的功能,所以,除了需要修改扩展 <code class="docutils literal notranslate"><span class="pre">os6</span></code> 目录下的代码外,还需要修改扩展 <code class="docutils literal notranslate"><span class="pre">easy-fs</span></code><code class="docutils literal notranslate"><span class="pre">easy-fs-fuse</span></code> 下面的部分代码。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p><strong>测试方式</strong></p>
<p>你的实现只需且必须通过测例,建议读者感到困惑时先检查测例</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test6</span></code> ,应该看到类似如下的显示输出:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span> YOUR_LAB4_REPO_DIR
<span class="gp">$ </span>make test6
<span class="go">......</span>
<span class="go">[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0</span>
<span class="go">.______ __ __ _______.___________. _______..______ __</span>
<span class="go">| _ \ | | | | / | | / || _ \ | |</span>
<span class="go">| |_) | | | | | | (----`---| |----`| (----`| |_) || |</span>
<span class="go">| / | | | | \ \ | | \ \ | _ &lt; | |</span>
<span class="go">| |\ \----.| `--' |.----) | | | .----) | | |_) || |</span>
<span class="go">| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|</span>
<span class="go">[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1</span>
<span class="go">[rustsbi] Platform Name : riscv-virtio,qemu</span>
<span class="go">[rustsbi] Platform SMP : 1</span>
<span class="go">[rustsbi] Platform Memory : 0x80000000..0x88000000</span>
<span class="go">[rustsbi] Boot HART : 0</span>
<span class="go">[rustsbi] Device Tree Region : 0x87000000..0x87000ef2</span>
<span class="go">[rustsbi] Firmware Address : 0x80000000</span>
<span class="go">[rustsbi] Supervisor Address : 0x80200000</span>
<span class="go">[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)</span>
<span class="go">[rustsbi] pmp02: 0x80000000..0x80200000 (---)</span>
<span class="go">[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)</span>
<span class="go">......</span>
<span class="go">[PASS] found &lt;Test 04_5 ummap OK53852!&gt;</span>
<span class="go">[PASS] found &lt;Test 04_1 OK53852!&gt;</span>
<span class="go">.....</span>
<span class="go">[PASS] found &lt;Test write C OK53852!&gt;</span>
<span class="go">[PASS] found &lt;get_time OK53852! (\d+)&gt;</span>
<span class="go">[PASS] not found &lt;FAIL: T.T&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_2 fail!&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_3 fail!&gt;</span>
<span class="go">Test passed53852: 27/27</span>
<span class="go">Report for lab1 found.</span>
<span class="go">Report for lab2 found.</span>
<span class="go">Report for lab3 found.</span>
<span class="go">Report for lab4 found.</span>
</pre></div>
</div>
</div>
<ul>
<li><p>提交你的修改</p>
<blockquote>

View File

@@ -378,10 +378,62 @@ m 个元素。初始时Work = Available ;结束向量 Finish表示系统
</div>
<div class="section" id="id2">
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题"></a></h3>
<ul>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref">lab5(os8)参考框架:</a></p></li>
<li><p>实验目录在 <code class="docutils literal notranslate"><span class="pre">os8</span></code></p></li>
<li><p>通过所有测例</p></li>
<li><p>开发并通过所有测例</p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">YOUR_LAB5_REPO_DIR</span></code> 下进行编码(可学习参考 <code class="docutils literal notranslate"><span class="pre">os8-ref/src</span></code> 目录下的源代码,并在 <code class="docutils literal notranslate"><span class="pre">os8/src</span></code> 中完成编码),并进行编译测试。</p>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p><strong>测试方式</strong></p>
<p>你的实现只需且必须通过测例,建议读者感到困惑时先检查测例</p>
<p>如果实现正确,可在项目仓库的根目录下执行 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">test8</span></code> ,应该看到类似如下的显示输出:</p>
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp">$ </span><span class="nb">cd</span> YOUR_LAB5_REPO_DIR
<span class="gp">$ </span>make test8
<span class="go">......</span>
<span class="go">[rustsbi] RustSBI version 0.2.2, adapting to RISC-V SBI v1.0.0</span>
<span class="go">.______ __ __ _______.___________. _______..______ __</span>
<span class="go">| _ \ | | | | / | | / || _ \ | |</span>
<span class="go">| |_) | | | | | | (----`---| |----`| (----`| |_) || |</span>
<span class="go">| / | | | | \ \ | | \ \ | _ &lt; | |</span>
<span class="go">| |\ \----.| `--' |.----) | | | .----) | | |_) || |</span>
<span class="go">| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|</span>
<span class="go">[rustsbi] Implementation : RustSBI-QEMU Version 0.1.1</span>
<span class="go">[rustsbi] Platform Name : riscv-virtio,qemu</span>
<span class="go">[rustsbi] Platform SMP : 1</span>
<span class="go">[rustsbi] Platform Memory : 0x80000000..0x88000000</span>
<span class="go">[rustsbi] Boot HART : 0</span>
<span class="go">[rustsbi] Device Tree Region : 0x87000000..0x87000ef2</span>
<span class="go">[rustsbi] Firmware Address : 0x80000000</span>
<span class="go">[rustsbi] Supervisor Address : 0x80200000</span>
<span class="go">[rustsbi] pmp01: 0x00000000..0x80000000 (-wr)</span>
<span class="go">[rustsbi] pmp02: 0x80000000..0x80200000 (---)</span>
<span class="go">[rustsbi] pmp03: 0x80200000..0x88000000 (xwr)</span>
<span class="go">......</span>
<span class="go">[PASS] found &lt;Hello, world from user mode program!&gt;</span>
<span class="go">[PASS] found &lt;Test power_3 OK60963!&gt;</span>
<span class="go">[PASS] found &lt;Test power_5 OK60963!&gt;</span>
<span class="go">......</span>
<span class="go">[PASS] found &lt;threads test passed60963!&gt;</span>
<span class="go">[PASS] found &lt;deadlock test mutex 1 OK60963!&gt;</span>
<span class="go">[PASS] found &lt;deadlock test semaphore 1 OK60963!&gt;</span>
<span class="go">[PASS] found &lt;deadlock test semaphore 2 OK60963!&gt;</span>
<span class="go">[PASS] found &lt;ch8 Usertests passed60963!&gt;</span>
<span class="go">[PASS] not found &lt;FAIL: T.T&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_2 fail!&gt;</span>
<span class="go">[PASS] not found &lt;Should cause error, Test 04_3 fail!&gt;</span>
<span class="go">Test passed60963: 29/29</span>
<span class="go">Report for lab1 found.</span>
<span class="go">Report for lab2 found.</span>
<span class="go">Report for lab3 found.</span>
<span class="go">Report for lab4 found.</span>
<span class="go">Report for lab5 found.</span>
</pre></div>
</div>
</div>
<ul>
<li><p>提交你的修改</p>
<blockquote>
<div><ul class="simple">

File diff suppressed because one or more lines are too long