mirror of
https://github.com/LearningOS/rust-based-os-comp2022.git
synced 2026-02-11 22:25:04 +08:00
deploy: 10933fff6e
This commit is contained in:
@@ -43,7 +43,7 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
|
||||
实验要求
|
||||
+++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
- `lab1(os3)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref>`
|
||||
- `lab1(os3)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref>`_
|
||||
|
||||
- 实验目录要求
|
||||
|
||||
@@ -64,7 +64,7 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
|
||||
|
||||
CI 使用的测例与本地相同,测试中,user 文件夹及其它与构建相关的文件将被替换,请不要试图依靠硬编码通过测试。
|
||||
|
||||
默认情况下,makefile 仅编译基础测例 (``BASE=1``),即无需修改框架即可正常运行的测例。
|
||||
在 ``os3`` 目录下,默认情况下,makefile 仅编译基础测例 (``BASE=1``),即无需修改框架即可正常运行的测例。
|
||||
你需要在编译时指定 ``BASE=0`` 控制框架仅编译实验测例(在 os 目录执行 ``make run BASE=0``),
|
||||
或指定 ``BASE=2`` 控制框架同时编译基础测例和实验测例。
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
chapter4练习
|
||||
============================================
|
||||
|
||||
编程作业
|
||||
Lab2 编程作业
|
||||
---------------------------------------------
|
||||
|
||||
重写 sys_get_time 和 sys_task_info
|
||||
@@ -60,9 +60,9 @@ tips:
|
||||
实验要求
|
||||
++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
- 实现分支:ch4。
|
||||
- 实现 mmap 和 munmap 两个系统调用,通过所有测例。
|
||||
- 实验目录请参考 ch3,报告命名 lab2.md/pdf
|
||||
- `lab2(os4)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os4-ref>`_
|
||||
- 在 ``os4`` 目录下,实现 mmap 和 munmap 两个系统调用,通过所有测例。
|
||||
- 报告命名 lab2.md,位于 ``reports`` 目录下
|
||||
|
||||
TIPS:注意 port 参数的语义,它与内核定义的 MapPermission 有明显不同!
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
chapter5练习
|
||||
==============================================
|
||||
|
||||
编程作业
|
||||
Lab3 编程作业
|
||||
---------------------------------------------
|
||||
|
||||
进程创建
|
||||
@@ -74,11 +74,11 @@ BigStride 表示一个预先定义的大常数,则该调度方案为每个进
|
||||
|
||||
实验要求
|
||||
+++++++++++++++++++++++++++++++++++++++++++++
|
||||
- 实现分支:ch5。
|
||||
- 实验目录请参考 ch3。注意在reports中放入lab1-3的所有报告。
|
||||
- `lab3(os5)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os5-ref>`_
|
||||
- 实验目录在 ``os5`` 。注意在reports中放入lab1-3的所有报告。
|
||||
- 通过所有测例。
|
||||
|
||||
在 os 目录下 ``make run BASE=2`` 加载所有测例, ``ch5_usertest`` 打包了所有你需要通过的测例,
|
||||
在 os5 目录下 ``make run BASE=2`` 加载所有测例, ``ch5_usertest`` 打包了所有你需要通过的测例,
|
||||
你也可以通过修改这个文件调整本地测试的内容, 或者单独运行某测例来纠正特定的错误。 ``ch5_stride``
|
||||
检查 stride 调度算法是否满足公平性要求,六个子程序运行的次数应该大致与其优先级呈正比,测试通过标准是
|
||||
:math:`\max{\frac{runtimes}{prio}}/ \min{\frac{runtimes}{prio}} < 1.5`.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
chapter6练习
|
||||
================================================
|
||||
|
||||
编程作业
|
||||
Lab4 编程作业
|
||||
-------------------------------------------------
|
||||
|
||||
硬链接
|
||||
@@ -85,11 +85,11 @@ chapter6练习
|
||||
|
||||
实验要求
|
||||
+++++++++++++++++++++++++++++++++++++++++++++
|
||||
- 实现分支:ch6。
|
||||
- `lab4(os6)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os6-ref>`_
|
||||
- 实验目录要求不变。
|
||||
- 通过所有测例。
|
||||
|
||||
在 os 目录下 ``make run BASE=2`` 加载所有测例, ``ch6_usertest`` 打包了所有你需要通过的测例,你也可以通过修改这个文件调整本地测试的内容。
|
||||
在 ``os6`` 目录下 ``make run BASE=2`` 加载所有测例, ``ch6_usertest`` 打包了所有你需要通过的测例,你也可以通过修改这个文件调整本地测试的内容。
|
||||
|
||||
你的内核必须前向兼容,能通过前一章的所有测例。
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
chapter8 练习
|
||||
=======================================
|
||||
|
||||
编程作业
|
||||
Lab5 编程作业
|
||||
--------------------------------------
|
||||
|
||||
.. warning::
|
||||
|
||||
本次实验框架变动较大,且改动较为复杂,为降低同学们的工作量,本次实验不要求合并之前的实验内容,
|
||||
只需通过 ch8 的全部测例和其他章节的基础测例即可。你可以直接在实验框架的 ch8 分支上完成以下作业。
|
||||
只需通过 ch8 的全部测例和其他章节的基础测例即可。你可以参考 `lab5(os8)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref>`_ 上完成以下作业。
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -84,8 +84,8 @@ chapter8 练习
|
||||
实验要求
|
||||
+++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
- 完成分支: ch8。
|
||||
- 实验目录要求不变。
|
||||
- `lab5(os8)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref>`_
|
||||
- 实验目录在 ``os8`` 。
|
||||
- 通过所有测例。
|
||||
|
||||
问答作业
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
<div class="section" id="id2">
|
||||
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p><cite>lab1(os3)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref></cite></p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref">lab1(os3)参考框架:</a></p></li>
|
||||
<li><p>实验目录要求</p></li>
|
||||
</ul>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>├── os3(内核实现)
|
||||
@@ -362,7 +362,7 @@
|
||||
<li><p>通过所有测例:</p>
|
||||
<blockquote>
|
||||
<div><p>CI 使用的测例与本地相同,测试中,user 文件夹及其它与构建相关的文件将被替换,请不要试图依靠硬编码通过测试。</p>
|
||||
<p>默认情况下,makefile 仅编译基础测例 (<code class="docutils literal notranslate"><span class="pre">BASE=1</span></code>),即无需修改框架即可正常运行的测例。
|
||||
<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>
|
||||
</div></blockquote>
|
||||
|
||||
@@ -290,8 +290,8 @@
|
||||
</div>
|
||||
<div class="section" id="chapter4">
|
||||
<h1>chapter4练习<a class="headerlink" href="#chapter4" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="id1">
|
||||
<h2>编程作业<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="lab2">
|
||||
<h2>Lab2 编程作业<a class="headerlink" href="#lab2" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="sys-get-time-sys-task-info">
|
||||
<h3>重写 sys_get_time 和 sys_task_info<a class="headerlink" href="#sys-get-time-sys-task-info" title="永久链接至标题">¶</a></h3>
|
||||
<p>引入虚存机制后,原来内核的 sys_get_time 和 sys_task_info 函数实现就无效了。请你重写这个函数,恢复其正常功能。</p>
|
||||
@@ -365,18 +365,18 @@
|
||||
<li><p>你增加 PTE_U 了吗?</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id1">
|
||||
<h3>实验要求<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p>实现分支:ch4。</p></li>
|
||||
<li><p>实现 mmap 和 munmap 两个系统调用,通过所有测例。</p></li>
|
||||
<li><p>实验目录请参考 ch3,报告命名 lab2.md/pdf</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os4-ref">lab2(os4)参考框架:</a></p></li>
|
||||
<li><p>在 <code class="docutils literal notranslate"><span class="pre">os4</span></code> 目录下,实现 mmap 和 munmap 两个系统调用,通过所有测例。</p></li>
|
||||
<li><p>报告命名 lab2.md,位于 <code class="docutils literal notranslate"><span class="pre">reports</span></code> 目录下</p></li>
|
||||
</ul>
|
||||
<p>TIPS:注意 port 参数的语义,它与内核定义的 MapPermission 有明显不同!</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h2>问答作业<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id2">
|
||||
<h2>问答作业<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||||
<ol class="arabic">
|
||||
<li><p>请列举 SV39 页表页表项的组成,描述其中的标志位有何作用?</p></li>
|
||||
<li><dl>
|
||||
@@ -418,8 +418,8 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="id4">
|
||||
<h2>报告要求<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id3">
|
||||
<h2>报告要求<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>简单总结你实现的功能(200字以内,不要贴代码)。</p></li>
|
||||
<li><p>完成问答题。</p></li>
|
||||
@@ -483,14 +483,14 @@
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">chapter4练习</a><ul>
|
||||
<li><a class="reference internal" href="#id1">编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#lab2">Lab2 编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#sys-get-time-sys-task-info">重写 sys_get_time 和 sys_task_info</a></li>
|
||||
<li><a class="reference internal" href="#mmap-munmap">mmap 和 munmap 匿名映射</a></li>
|
||||
<li><a class="reference internal" href="#id2">实验要求</a></li>
|
||||
<li><a class="reference internal" href="#id1">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#id3">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id4">报告要求</a></li>
|
||||
<li><a class="reference internal" href="#id2">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id3">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -348,14 +348,14 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="7exercise.html">chapter4练习</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#id1">编程作业</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#lab2">Lab2 编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="7exercise.html#sys-get-time-sys-task-info">重写 sys_get_time 和 sys_task_info</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="7exercise.html#mmap-munmap">mmap 和 munmap 匿名映射</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="7exercise.html#id2">实验要求</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="7exercise.html#id1">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#id3">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#id4">报告要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#id2">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="7exercise.html#id3">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -290,10 +290,10 @@
|
||||
</div>
|
||||
<div class="section" id="chapter5">
|
||||
<h1>chapter5练习<a class="headerlink" href="#chapter5" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="lab3">
|
||||
<h2>Lab3 编程作业<a class="headerlink" href="#lab3" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id1">
|
||||
<h2>编程作业<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id2">
|
||||
<h3>进程创建<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<h3>进程创建<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h3>
|
||||
<p>大家一定好奇过为啥进程创建要用 fork + exec 这么一个奇怪的系统调用,就不能直接搞一个新进程吗?
|
||||
思而不学则殆,我们就来试一试!这章的编程练习请大家实现一个完全 DIY 的系统调用 spawn,用以创建一个新进程。</p>
|
||||
<p>spawn 系统调用定义( <a class="reference external" href="https://man7.org/linux/man-pages/man3/posix_spawn.3.html">标准spawn看这里</a> ):</p>
|
||||
@@ -355,13 +355,13 @@ BigStride 表示一个预先定义的大常数,则该调度方案为每个进
|
||||
<p>背景知识: <a class="reference external" href="https://rcore-os.github.io/rCore-Tutorial-Book-v3/chapter4/1rust-dynamic-allocation.html">Rust 中的动态内存分配</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h3>实验要求<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id2">
|
||||
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<ul>
|
||||
<li><p>实现分支:ch5。</p></li>
|
||||
<li><p>实验目录请参考 ch3。注意在reports中放入lab1-3的所有报告。</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os5-ref">lab3(os5)参考框架:</a></p></li>
|
||||
<li><p>实验目录在 <code class="docutils literal notranslate"><span class="pre">os5</span></code> 。注意在reports中放入lab1-3的所有报告。</p></li>
|
||||
<li><p>通过所有测例。</p>
|
||||
<p>在 os 目录下 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span> <span class="pre">BASE=2</span></code> 加载所有测例, <code class="docutils literal notranslate"><span class="pre">ch5_usertest</span></code> 打包了所有你需要通过的测例,
|
||||
<p>在 os5 目录下 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span> <span class="pre">BASE=2</span></code> 加载所有测例, <code class="docutils literal notranslate"><span class="pre">ch5_usertest</span></code> 打包了所有你需要通过的测例,
|
||||
你也可以通过修改这个文件调整本地测试的内容, 或者单独运行某测例来纠正特定的错误。 <code class="docutils literal notranslate"><span class="pre">ch5_stride</span></code>
|
||||
检查 stride 调度算法是否满足公平性要求,六个子程序运行的次数应该大致与其优先级呈正比,测试通过标准是
|
||||
<span class="math notranslate nohighlight">\(\max{\frac{runtimes}{prio}}/ \min{\frac{runtimes}{prio}} < 1.5\)</span>.</p>
|
||||
@@ -375,8 +375,8 @@ BigStride 表示一个预先定义的大常数,则该调度方案为每个进
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id4">
|
||||
<h2>问答作业<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id3">
|
||||
<h2>问答作业<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<p>stride 算法深入</p>
|
||||
<blockquote>
|
||||
<div><p>stride 算法原理非常简单,但是有一个比较大的问题。例如两个 pass = 10 的进程,使用 8bit 无符号整形储存
|
||||
@@ -411,8 +411,8 @@ stride, p1.stride = 255, p2.stride = 250,在 p2 执行一个时间片后,
|
||||
<p>TIPS: 使用 8 bits 存储 stride, BigStride = 255, 则: <code class="docutils literal notranslate"><span class="pre">(125</span> <span class="pre"><</span> <span class="pre">255)</span> <span class="pre">==</span> <span class="pre">false</span></code>, <code class="docutils literal notranslate"><span class="pre">(129</span> <span class="pre"><</span> <span class="pre">255)</span> <span class="pre">==</span> <span class="pre">true</span></code>.</p>
|
||||
</div></blockquote>
|
||||
</div>
|
||||
<div class="section" id="id5">
|
||||
<h2>报告要求<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id4">
|
||||
<h2>报告要求<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>简单总结你实现的功能(200字以内,不要贴代码)。</p></li>
|
||||
<li><p>完成问答题。</p></li>
|
||||
@@ -476,14 +476,14 @@ stride, p1.stride = 255, p2.stride = 250,在 p2 执行一个时间片后,
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">chapter5练习</a><ul>
|
||||
<li><a class="reference internal" href="#id1">编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id2">进程创建</a></li>
|
||||
<li><a class="reference internal" href="#lab3">Lab3 编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id1">进程创建</a></li>
|
||||
<li><a class="reference internal" href="#stride">stride 调度算法</a></li>
|
||||
<li><a class="reference internal" href="#id3">实验要求</a></li>
|
||||
<li><a class="reference internal" href="#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#id4">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id5">报告要求</a></li>
|
||||
<li><a class="reference internal" href="#id3">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id4">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -348,14 +348,14 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="4exercise.html">chapter5练习</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id1">编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id2">进程创建</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#lab3">Lab3 编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id1">进程创建</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#stride">stride 调度算法</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id3">实验要求</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id4">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id5">报告要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id3">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id4">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -290,10 +290,10 @@
|
||||
</div>
|
||||
<div class="section" id="chapter6">
|
||||
<h1>chapter6练习<a class="headerlink" href="#chapter6" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="lab4">
|
||||
<h2>Lab4 编程作业<a class="headerlink" href="#lab4" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id1">
|
||||
<h2>编程作业<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id2">
|
||||
<h3>硬链接<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<h3>硬链接<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h3>
|
||||
<p>硬链接要求两个不同的目录项指向同一个文件,在我们的文件系统中也就是两个不同名称目录项指向同一个磁盘块。</p>
|
||||
<p>本节要求实现三个系统调用 <code class="docutils literal notranslate"><span class="pre">sys_linkat、sys_unlinkat、sys_stat</span></code> 。</p>
|
||||
<p><strong>linkat</strong>:</p>
|
||||
@@ -408,13 +408,13 @@
|
||||
</ul>
|
||||
</div></blockquote>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h3>实验要求<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id2">
|
||||
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<ul>
|
||||
<li><p>实现分支:ch6。</p></li>
|
||||
<li><p><a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os6-ref">lab4(os6)参考框架:</a></p></li>
|
||||
<li><p>实验目录要求不变。</p></li>
|
||||
<li><p>通过所有测例。</p>
|
||||
<p>在 os 目录下 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span> <span class="pre">BASE=2</span></code> 加载所有测例, <code class="docutils literal notranslate"><span class="pre">ch6_usertest</span></code> 打包了所有你需要通过的测例,你也可以通过修改这个文件调整本地测试的内容。</p>
|
||||
<p>在 <code class="docutils literal notranslate"><span class="pre">os6</span></code> 目录下 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">run</span> <span class="pre">BASE=2</span></code> 加载所有测例, <code class="docutils literal notranslate"><span class="pre">ch6_usertest</span></code> 打包了所有你需要通过的测例,你也可以通过修改这个文件调整本地测试的内容。</p>
|
||||
<p>你的内核必须前向兼容,能通过前一章的所有测例。</p>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -426,14 +426,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id4">
|
||||
<h2>问答作业<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id3">
|
||||
<h2>问答作业<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<ol class="arabic simple">
|
||||
<li><p>在我们的easy-fs中,root inode起着什么作用?如果root inode中的内容损坏了,会发生什么?</p></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="id5">
|
||||
<h2>报告要求<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id4">
|
||||
<h2>报告要求<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p>简单总结你实现的功能(200字以内,不要贴代码)。</p></li>
|
||||
<li><p>完成问答题。</p></li>
|
||||
@@ -497,13 +497,13 @@
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">chapter6练习</a><ul>
|
||||
<li><a class="reference internal" href="#id1">编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id2">硬链接</a></li>
|
||||
<li><a class="reference internal" href="#id3">实验要求</a></li>
|
||||
<li><a class="reference internal" href="#lab4">Lab4 编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id1">硬链接</a></li>
|
||||
<li><a class="reference internal" href="#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#id4">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id5">报告要求</a></li>
|
||||
<li><a class="reference internal" href="#id3">问答作业</a></li>
|
||||
<li><a class="reference internal" href="#id4">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -360,13 +360,13 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="4exercise.html">chapter6练习</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id1">编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id2">硬链接</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id3">实验要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#lab4">Lab4 编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id1">硬链接</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="4exercise.html#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id4">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id5">报告要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id3">问答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="4exercise.html#id4">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -290,19 +290,19 @@
|
||||
</div>
|
||||
<div class="section" id="chapter8">
|
||||
<h1>chapter8 练习<a class="headerlink" href="#chapter8" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="id1">
|
||||
<h2>编程作业<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="lab5">
|
||||
<h2>Lab5 编程作业<a class="headerlink" href="#lab5" title="永久链接至标题">¶</a></h2>
|
||||
<div class="admonition warning">
|
||||
<p class="admonition-title">警告</p>
|
||||
<p>本次实验框架变动较大,且改动较为复杂,为降低同学们的工作量,本次实验不要求合并之前的实验内容,
|
||||
只需通过 ch8 的全部测例和其他章节的基础测例即可。你可以直接在实验框架的 ch8 分支上完成以下作业。</p>
|
||||
只需通过 ch8 的全部测例和其他章节的基础测例即可。你可以参考 <a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os8-ref">lab5(os8)参考框架:</a> 上完成以下作业。</p>
|
||||
</div>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">注解</p>
|
||||
<p>本次实验的工作量约为 100 行代码。</p>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h3>死锁检测<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id1">
|
||||
<h3>死锁检测<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h3>
|
||||
<p>目前的 mutex 和 semaphore 相关的系统调用不会分析资源的依赖情况,用户程序可能出现死锁。
|
||||
我们希望在系统中加入死锁检测机制,当发现可能发生死锁时拒绝对应的资源获取请求。
|
||||
一种检测死锁的算法如下:</p>
|
||||
@@ -376,11 +376,11 @@ m 个元素。初始时,Work = Available ;结束向量 Finish,表示系统
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h3>实验要求<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h3>
|
||||
<div class="section" id="id2">
|
||||
<h3>实验要求<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h3>
|
||||
<ul class="simple">
|
||||
<li><p>完成分支: ch8。</p></li>
|
||||
<li><p>实验目录要求不变。</p></li>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -484,9 +484,9 @@ m 个元素。初始时,Work = Available ;结束向量 Finish,表示系统
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">chapter8 练习</a><ul>
|
||||
<li><a class="reference internal" href="#id1">编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id2">死锁检测</a></li>
|
||||
<li><a class="reference internal" href="#id3">实验要求</a></li>
|
||||
<li><a class="reference internal" href="#lab5">Lab5 编程作业</a><ul>
|
||||
<li><a class="reference internal" href="#id1">死锁检测</a></li>
|
||||
<li><a class="reference internal" href="#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#id4">问答作业</a></li>
|
||||
|
||||
@@ -365,9 +365,9 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="5exercise.html">chapter8 练习</a><ul>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#id1">编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="5exercise.html#id2">死锁检测</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="5exercise.html#id3">实验要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#lab5">Lab5 编程作业</a><ul>
|
||||
<li class="toctree-l3"><a class="reference internal" href="5exercise.html#id1">死锁检测</a></li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="5exercise.html#id2">实验要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#id4">问答作业</a></li>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user