mirror of
https://github.com/LearningOS/rust-based-os-comp2022.git
synced 2026-05-05 13:20:32 +08:00
deploy: 33b280adf3
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<html class="no-js" lang="zh_CN">
|
||||
<head><meta charset="utf-8"/>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
||||
<meta name="color-scheme" content="light dark"><link rel="index" title="索引" href="genindex.html" /><link rel="search" title="搜索" href="search.html" /><link rel="next" title="第一章:应用程序与基本执行环境" href="chapter1/index.html" /><link rel="prev" title="rCore-Tutorial-Guide 2022 春季学期" href="index.html" />
|
||||
<meta name="color-scheme" content="light dark"><link rel="index" title="索引" href="genindex.html" /><link rel="search" title="搜索" href="search.html" /><link rel="next" title="第一章:应用程序与基本执行环境" href="chapter1/index.html" /><link rel="prev" title="2022年开源操作系统训练营" href="index.html" />
|
||||
|
||||
<meta name="generator" content="sphinx-4.1.2, furo 2021.08.31"/>
|
||||
<title>第零章:实验环境配置 - rCore-Tutorial-Guide-2022S 文档</title>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
chapter3练习
|
||||
=======================================
|
||||
|
||||
编程作业
|
||||
Lab1 编程作业
|
||||
--------------------------------------
|
||||
|
||||
获取任务信息
|
||||
@@ -43,13 +43,13 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
|
||||
实验要求
|
||||
+++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
- 完成分支: ch3。
|
||||
- `lab1(os3)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref>`
|
||||
|
||||
- 实验目录要求
|
||||
|
||||
.. code-block::
|
||||
|
||||
├── os(内核实现)
|
||||
├── os3(内核实现)
|
||||
│ ├── Cargo.toml(配置文件)
|
||||
│ └── src(所有内核的源代码放在 os/src 目录下)
|
||||
│ ├── main.rs(内核主函数)
|
||||
@@ -77,11 +77,11 @@ ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我
|
||||
--------------------------------------------
|
||||
|
||||
1. 正确进入 U 态后,程序的特征还应有:使用 S 态特权指令,访问 S 态寄存器后会报错。
|
||||
请同学们可以自行测试这些内容 (运行 `Rust 三个 bad 测例 (ch2b_bad_*.rs) <https://github.com/LearningOS/rCore-Tutorial-Test-2022S/tree/master/src/bin>`_ ,
|
||||
请同学们可以自行测试这些内容 (运行 `Rust 三个 bad 测例 (ch2b_bad_*.rs) <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/user/src/bin>`_ ,
|
||||
注意在编译时至少需要指定 ``LOG=ERROR`` 才能观察到内核的报错信息) ,
|
||||
描述程序出错行为,同时注意注明你使用的 sbi 及其版本。
|
||||
|
||||
2. 深入理解 `trap.S <https://github.com/LearningOS/rCore-Tutorial-Code-2022S/blob/ch3/os/src/trap/trap.S>`_
|
||||
2. 深入理解 `trap.S <https://github.com/LearningOS/rust-based-os-comp2022/blob/main/os3-ref/src/trap/trap.S>`_
|
||||
中两个函数 ``__alltraps`` 和 ``__restore`` 的作用,并回答如下问题:
|
||||
|
||||
1. L40:刚进入 ``__restore`` 时,``a0`` 代表了什么值。请指出 ``__restore`` 的两种使用情景。
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
rCore-Tutorial-Guide 2022 春季学期
|
||||
2022年开源操作系统训练营
|
||||
==================================================
|
||||
|
||||
.. toctree::
|
||||
@@ -45,7 +45,7 @@ rCore-Tutorial-Guide 2022 春季学期
|
||||
|
||||
本教程展示了如何 **从零开始** 用 **Rust** 语言写一个基于 **RISC-V** 架构的 **类 Unix 内核** 。
|
||||
|
||||
用于 2022 年春季学期操作系统课堂教学。
|
||||
用于 2022年开源操作系统训练营。
|
||||
|
||||
导读
|
||||
---------------------
|
||||
@@ -61,7 +61,7 @@ rCore-Tutorial-Guide 2022 春季学期
|
||||
|
||||
鸣谢
|
||||
----------------------
|
||||
本项目基于 `2021 年秋季学期操作系统实验指导书 <https://github.com/LearningOS/rCore-Tutorial-Guide-2021A>`_ ,重构的目标是在保留结构的基础上屏蔽不必要的细节,缩短篇幅,优化语言,降低阅读成本。
|
||||
本项目基于 `2022 年春季学期操作系统实验指导书 <https://github.com/LearningOS/rCore-Tutorial-Code-2022S>`_ ,重构的目标是在保留结构的基础上屏蔽不必要的细节,缩短篇幅,优化语言,降低阅读成本。
|
||||
|
||||
如果你觉得本教程某些章节不够细致或不够连贯,可以参考上学期实验指导书的对应章节。
|
||||
|
||||
|
||||
@@ -290,10 +290,10 @@
|
||||
</div>
|
||||
<div class="section" id="chapter3">
|
||||
<h1>chapter3练习<a class="headerlink" href="#chapter3" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="lab1">
|
||||
<h2>Lab1 编程作业<a class="headerlink" href="#lab1" 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>ch3 中,我们的系统已经能够支持多个任务分时轮流运行,我们希望引入一个新的系统调用 <code class="docutils literal notranslate"><span class="pre">sys_task_info</span></code> 以获取当前任务的信息,定义如下:</p>
|
||||
<div class="highlight-rust notranslate"><div class="highlight"><pre><span></span><span class="k">fn</span> <span class="nf">sys_task_info</span><span class="p">(</span><span class="n">ti</span>: <span class="o">*</span><span class="k">mut</span><span class="w"> </span><span class="n">TaskInfo</span><span class="p">)</span><span class="w"> </span>-> <span class="kt">isize</span>
|
||||
</pre></div>
|
||||
@@ -341,13 +341,13 @@
|
||||
</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>完成分支: ch3。</p></li>
|
||||
<li><p><cite>lab1(os3)参考框架: <https://github.com/LearningOS/rust-based-os-comp2022/tree/main/os3-ref></cite></p></li>
|
||||
<li><p>实验目录要求</p></li>
|
||||
</ul>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>├── os(内核实现)
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>├── os3(内核实现)
|
||||
│ ├── Cargo.toml(配置文件)
|
||||
│ └── src(所有内核的源代码放在 os/src 目录下)
|
||||
│ ├── main.rs(内核主函数)
|
||||
@@ -374,14 +374,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">
|
||||
<li><p>正确进入 U 态后,程序的特征还应有:使用 S 态特权指令,访问 S 态寄存器后会报错。
|
||||
请同学们可以自行测试这些内容 (运行 <a class="reference external" href="https://github.com/LearningOS/rCore-Tutorial-Test-2022S/tree/master/src/bin">Rust 三个 bad 测例 (ch2b_bad_*.rs)</a> ,
|
||||
请同学们可以自行测试这些内容 (运行 <a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/tree/main/user/src/bin">Rust 三个 bad 测例 (ch2b_bad_*.rs)</a> ,
|
||||
注意在编译时至少需要指定 <code class="docutils literal notranslate"><span class="pre">LOG=ERROR</span></code> 才能观察到内核的报错信息) ,
|
||||
描述程序出错行为,同时注意注明你使用的 sbi 及其版本。</p></li>
|
||||
<li><p>深入理解 <a class="reference external" href="https://github.com/LearningOS/rCore-Tutorial-Code-2022S/blob/ch3/os/src/trap/trap.S">trap.S</a>
|
||||
<li><p>深入理解 <a class="reference external" href="https://github.com/LearningOS/rust-based-os-comp2022/blob/main/os3-ref/src/trap/trap.S">trap.S</a>
|
||||
中两个函数 <code class="docutils literal notranslate"><span class="pre">__alltraps</span></code> 和 <code class="docutils literal notranslate"><span class="pre">__restore</span></code> 的作用,并回答如下问题:</p>
|
||||
<ol class="arabic">
|
||||
<li><p>L40:刚进入 <code class="docutils literal notranslate"><span class="pre">__restore</span></code> 时,<code class="docutils literal notranslate"><span class="pre">a0</span></code> 代表了什么值。请指出 <code class="docutils literal notranslate"><span class="pre">__restore</span></code> 的两种使用情景。</p></li>
|
||||
@@ -422,8 +422,8 @@
|
||||
</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>
|
||||
@@ -487,13 +487,13 @@
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">chapter3练习</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="#lab1">Lab1 编程作业</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>
|
||||
|
||||
@@ -322,13 +322,13 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l1"><a class="reference internal" href="5exercise.html">chapter3练习</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#lab1">Lab1 编程作业</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>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#id5">报告要求</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#id3">简答作业</a></li>
|
||||
<li class="toctree-l2"><a class="reference internal" href="5exercise.html#id4">报告要求</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
36
index.html
36
index.html
@@ -288,21 +288,21 @@
|
||||
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
|
||||
</label>
|
||||
</div>
|
||||
<div class="section" id="rcore-tutorial-guide-2022">
|
||||
<h1>rCore-Tutorial-Guide 2022 春季学期<a class="headerlink" href="#rcore-tutorial-guide-2022" title="永久链接至标题">¶</a></h1>
|
||||
<div class="section" id="id1">
|
||||
<h1>2022年开源操作系统训练营<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
</div>
|
||||
<div class="toctree-wrapper compound">
|
||||
</div>
|
||||
<div class="toctree-wrapper compound">
|
||||
</div>
|
||||
<div class="section" id="id1">
|
||||
<h2>项目简介<a class="headerlink" href="#id1" title="永久链接至标题">¶</a></h2>
|
||||
<p>本教程展示了如何 <strong>从零开始</strong> 用 <strong>Rust</strong> 语言写一个基于 <strong>RISC-V</strong> 架构的 <strong>类 Unix 内核</strong> 。</p>
|
||||
<p>用于 2022 年春季学期操作系统课堂教学。</p>
|
||||
</div>
|
||||
<div class="section" id="id2">
|
||||
<h2>导读<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||||
<h2>项目简介<a class="headerlink" href="#id2" title="永久链接至标题">¶</a></h2>
|
||||
<p>本教程展示了如何 <strong>从零开始</strong> 用 <strong>Rust</strong> 语言写一个基于 <strong>RISC-V</strong> 架构的 <strong>类 Unix 内核</strong> 。</p>
|
||||
<p>用于 2022年开源操作系统训练营。</p>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h2>导读<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<p>请先阅读 <a class="reference internal" href="0setup-devel-env.html"><span class="doc">第零章:实验环境配置</span></a> 完成环境配置。</p>
|
||||
<p>以下是读者为了完成实验需掌握的技术,你可以在实操中熟悉它们。</p>
|
||||
<ul class="simple">
|
||||
@@ -312,9 +312,9 @@
|
||||
<li><p>Rust 基本语法和一些进阶语法,包括 <strong>Cargo 项目结构、Trait、函数式编程、Unsafe Rust、错误处理等</strong> 。</p></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="id3">
|
||||
<h2>鸣谢<a class="headerlink" href="#id3" title="永久链接至标题">¶</a></h2>
|
||||
<p>本项目基于 <a class="reference external" href="https://github.com/LearningOS/rCore-Tutorial-Guide-2021A">2021 年秋季学期操作系统实验指导书</a> ,重构的目标是在保留结构的基础上屏蔽不必要的细节,缩短篇幅,优化语言,降低阅读成本。</p>
|
||||
<div class="section" id="id4">
|
||||
<h2>鸣谢<a class="headerlink" href="#id4" title="永久链接至标题">¶</a></h2>
|
||||
<p>本项目基于 <a class="reference external" href="https://github.com/LearningOS/rCore-Tutorial-Code-2022S">2022 年春季学期操作系统实验指导书</a> ,重构的目标是在保留结构的基础上屏蔽不必要的细节,缩短篇幅,优化语言,降低阅读成本。</p>
|
||||
<p>如果你觉得本教程某些章节不够细致或不够连贯,可以参考上学期实验指导书的对应章节。</p>
|
||||
<div class="admonition note">
|
||||
<p class="admonition-title">注解</p>
|
||||
@@ -325,8 +325,8 @@
|
||||
<p>虽然实验本身在总评中占比有限,但根据往届经验,考试中可能大量出现与编程作业、思考题、代码实现思路直接相关的题目。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="id5">
|
||||
<h2>项目协作<a class="headerlink" href="#id5" title="永久链接至标题">¶</a></h2>
|
||||
<div class="section" id="id6">
|
||||
<h2>项目协作<a class="headerlink" href="#id6" title="永久链接至标题">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference internal" href="setup-sphinx.html"><span class="doc">修改和构建本项目</span></a> 介绍了如何基于 Sphinx 框架配置文档开发环境,之后可以本地构建并渲染 html 或其他格式的文档;</p></li>
|
||||
<li><p><a class="reference internal" href="rest-example.html"><span class="doc">reStructuredText 基本语法</span></a> 给出了目前编写文档才用的 ReStructuredText 标记语言的一些基础语法及用例;</p></li>
|
||||
@@ -380,11 +380,11 @@
|
||||
<div class="toc-tree-container">
|
||||
<div class="toc-tree">
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">rCore-Tutorial-Guide 2022 春季学期</a><ul>
|
||||
<li><a class="reference internal" href="#id1">项目简介</a></li>
|
||||
<li><a class="reference internal" href="#id2">导读</a></li>
|
||||
<li><a class="reference internal" href="#id3">鸣谢</a></li>
|
||||
<li><a class="reference internal" href="#id5">项目协作</a></li>
|
||||
<li><a class="reference internal" href="#">2022年开源操作系统训练营</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="#id4">鸣谢</a></li>
|
||||
<li><a class="reference internal" href="#id6">项目协作</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
BIN
objects.inv
BIN
objects.inv
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user