Skip to content

Commit a33ff5b

Browse files
author
deployBot
committed
Deploy at Tue Apr 9 02:07:37 UTC 2024
1 parent 035a71f commit a33ff5b

36 files changed

+144
-175
lines changed
Lines changed: 37 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,56 @@
11
=========================
2-
Assignment 0 - Kernel API
2+
作业 0——内核 API
33
=========================
44

5-
- Deadline: :command:`Sunday, 26 March 2023, 23:00`
5+
- 截止日期: :command:`2023 年 3 月 26 日,23:00`
66

7-
Assignment's Objectives
7+
作业目标
88
=======================
99

10-
* getting familiar with the qemu setup
11-
* loading/unloading kernel modules
12-
* getting familiar with the list API implemented in the kernel
13-
* have fun :)
10+
* 熟悉 qemu 的设置
11+
* 加载/卸载内核模块
12+
* 熟悉内核中实现的列表 API
13+
* 玩得开心 :)
1414

15-
Statement
15+
说明
1616
=========
1717

18-
Write a kernel module called `list` (the resulting file must be called `list.ko`) which stores data (strings)
19-
in an internal list.
18+
编写名为 `list` 的内核模块(生成的文件必须命名为 `list.ko`),该模块在内部列表中存储数据(字符串)。
2019

21-
It is mandatory to use `the list API <https://github.com/torvalds/linux/blob/master/include/linux/list.h>`__
22-
implemented in the kernel.
23-
For details you can take a look at `the laboratory 2 <https://linux-kernel-labs.github.io/refs/heads/master/so2/lab2-kernel-api.html>`__.
20+
必须使用内核中实现的 `列表 API <https://github.com/torvalds/linux/blob/master/include/linux/list.h>`__。有关详细信息,请参阅 `实验 2 </so2/lab2-kernel-api.html>`__。
2421

25-
The module exports a directory named :command:`list` to procfs. The directory contains two files:
22+
该模块向 procfs 导出名为 :command:`list` 的目录。该目录包含两个文件:
2623

27-
- :command:`management`: with write-only access; is the interface for transmitting commands to the kernel module
28-
- :command:`preview`: with read-only access; is the interface through which the internal contents of the kernel list can be viewed.
24+
- :command:`management`:只能写入;用于向内核模块传输命令的接口
25+
- :command:`preview`:只读;用于查看内核列表的内部内容的接口。
2926

30-
`The code skeleton <https://github.com/linux-kernel-labs/linux/blob/master/tools/labs/templates/assignments/0-list/list.c>`__ implements the two procfs files.
31-
You will need to create a list and implement support for `adding` and `reading` data. Follow the TODOs in the code for details.
27+
`代码骨架 <https://github.com/linux-kernel-labs/linux/blob/master/tools/labs/templates/assignments/0-list/list.c>`__ 实现了这两个 procfs 文件。你需要创建一个列表,并实现对数据的 `添加` 和 `读取` 支持。请按照代码中的 TODO 进行操作。
3228

33-
To interact with the kernel list, you must write commands (using the `echo` command) in the `/proc/list/management` file:
29+
要与内核列表进行交互,你必须在 `/proc/list/management` 文件中编写命令(使用 `echo` 命令):
3430

35-
- `addf name`: adds the `name` element to the top of the list
36-
- `adde name`: adds the `name` element to the end of the list
37-
- `delf name`: deletes the first appearance of the `name` item from the list
38-
- `dela name`: deletes all occurrences of the `name` element in the list
31+
- `addf name`:将 `name` 元素添加到列表的顶部
32+
- `adde name`:将 `name` 元素添加到列表的末尾
33+
- `delf name`:删除列表中第一个 `name`
34+
- `dela name`:删除列表中所有的 `name` 元素
3935

40-
Viewing the contents of the list is done by viewing the contents of the `/proc/list/preview` file (use the` cat` command).
41-
The format contains one element on each line.
36+
要想查看列表内容,可以查看 `/proc/list/preview` 文件的内容(使用 `cat` 命令)。格式为每行一个元素。
4237

43-
Testing
38+
测试
4439
=======
4540

46-
In order to simplify the assignment evaluation process, but also to reduce the mistakes of the submitted assignments,
47-
the assignment evaluation will be done automatically with the help of a
48-
`test script <https://github.com/linux-kernel-labs/linux/blob/master/tools/labs/templates/assignments/0-list/checker/_checker>`__ called `_checker`.
49-
The test script assumes that the kernel module is called `list.ko`.
41+
为了简化作业评估过程,同时也为了减少提交作业时的错误,作业评估将通过一个名为 `_checker` 的 `测试脚本 <https://github.com/linux-kernel-labs/linux/blob/master/tools/labs/templates/assignments/0-list/checker/_checker>`__ 自动进行。测试脚本假定内核模块名为 `list.ko`。
5042

51-
QuickStart
43+
快速入门
5244
==========
5345

54-
It is mandatory to start the implementation of the assignment from the code skeleton found in the `list.c <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/src/list.c>`__ file.
55-
You should follow the instructions in the `README.md file <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__ of the `assignment's repo <https://gitlab.cs.pub.ro/so2/0-list>`__.
46+
必须从 `list.c <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/src/list.c>`__ 文件中找到的代码骨架开始实现作业。你应该按照 `任务仓库 <https://gitlab.cs.pub.ro/so2/0-list>`__ 的 `README.md 文件 <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__ 中的说明进行操作。
5647

57-
Tips
48+
提示
5849
----
5950

60-
To increase your chances of getting the highest grade, read and follow the Linux kernel
61-
coding style described in the `Coding Style document <https://elixir.bootlin.com/linux/v4.19.19/source/Documentation/process/coding-style.rst>`__.
51+
要想增加获得最高分的机会,请阅读并遵循 Linux 内核编码风格,该风格在 `代码风格文档 <https://elixir.bootlin.com/linux/v4.19.19/source/Documentation/process/coding-style.rst>`__ 中有描述。
6252

63-
Also, use the following static analysis tools to verify the code:
53+
此外,使用以下静态分析工具来验证代码:
6454

6555
- checkpatch.pl
6656

@@ -83,29 +73,24 @@ Also, use the following static analysis tools to verify the code:
8373
$ sudo apt-get install cppcheck
8474
$ cppcheck /path/to/your/list.c
8575
86-
Penalties
76+
处罚
8777
---------
88-
Information about assigments penalties can be found on the
89-
`General Directions page <https://ocw.cs.pub.ro/courses/so2/teme/general>`__.
9078

91-
In exceptional cases (the assigment passes the tests by not complying with the requirements)
92-
and if the assigment does not pass all the tests, the grade will may decrease more than mentioned above.
79+
有关作业处罚的信息可以在 `基本说明页面 <https://ocw.cs.pub.ro/courses/so2/teme/general>`__ 中找到。
9380

94-
Submitting the assigment
81+
在特殊情况下(作业通过测试,但不符合要求)会有处罚;如果作业未通过所有测试,成绩可能会降低更多。
82+
83+
提交作业
9584
------------------------
9685

97-
The assignment will be graded automatically using the `vmchecker-next <https://github.com/systems-cs-pub-ro/vmchecker-next/wiki/Student-Handbook>`__ infrastructure.
98-
The submission will be made on moodle on the `course's page <https://curs.upb.ro/2022/course/view.php?id=5121>`__ to the related assignment.
99-
You will find the submission details in the `README.md file <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__ of the `repo <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master>`__.
86+
使用 `vmchecker-next <https://github.com/systems-cs-pub-ro/vmchecker-next/wiki/Student-Handbook>`__ 基础设施自动对作业进行评分。提交将在 moodle 上的 `课程页面 <https://curs.upb.ro/2022/course/view.php?id=5121>`__ 上与相关作业相关联。你可以在 `仓库 <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master>`__ 的 `README.md 文件 <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__ 中找到提交详细信息。
10087

101-
Resources
88+
资源
10289
=========
10390

104-
We recommend that you use gitlab to store your homework. Follow the directions in
105-
`README.md file <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__.
91+
我们建议你使用 gitlab 存储作业。请按照 `README.md 文件 <https://gitlab.cs.pub.ro/so2/0-list/-/blob/master/README.md>`__ 中的说明进行操作。
10692

107-
Questions
93+
问题
10894
=========
10995

110-
For questions about the topic, you can consult the mailing `list archives <http://cursuri.cs.pub.ro/pipermail/so2/>`__
111-
or you can write a question on the dedicated Teams channel.
96+
如果你有相关的问题,你可以查阅邮件 `列表存档 <http://cursuri.cs.pub.ro/pipermail/so2/>`__,或在专用的 Teams 频道上提出问题。

index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -931,18 +931,18 @@ <h1>Linux 内核教学<a class="headerlink" href="#linux" title="永久链接至
931931
<li class="toctree-l3"><a class="reference internal" href="so2/assign-collaboration.html#section-6">6. 合并工作</a></li>
932932
</ul>
933933
</li>
934-
<li class="toctree-l2"><a class="reference internal" href="so2/assign0-kernel-api.html">Assignment 0 - Kernel API</a><ul>
935-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#assignment-s-objectives">Assignment's Objectives</a></li>
936-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#statement">Statement</a></li>
937-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#testing">Testing</a></li>
938-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#quickstart">QuickStart</a><ul>
939-
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#tips">Tips</a></li>
940-
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#penalties">Penalties</a></li>
941-
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#submitting-the-assigment">Submitting the assigment</a></li>
942-
</ul>
943-
</li>
944-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#resources">Resources</a></li>
945-
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#questions">Questions</a></li>
934+
<li class="toctree-l2"><a class="reference internal" href="so2/assign0-kernel-api.html">作业 0——内核 API</a><ul>
935+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-1">作业目标</a></li>
936+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-2">说明</a></li>
937+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-3">测试</a></li>
938+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-4">快速入门</a><ul>
939+
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-5">提示</a></li>
940+
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-6">处罚</a></li>
941+
<li class="toctree-l4"><a class="reference internal" href="so2/assign0-kernel-api.html#section-7">提交作业</a></li>
942+
</ul>
943+
</li>
944+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-8">资源</a></li>
945+
<li class="toctree-l3"><a class="reference internal" href="so2/assign0-kernel-api.html#section-9">问题</a></li>
946946
</ul>
947947
</li>
948948
<li class="toctree-l2"><a class="reference internal" href="so2/assign1-kprobe-based-tracer.html">Assignment 1 - Kprobe based tracer</a><ul>

objects.inv

24 Bytes
Binary file not shown.

searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

so2/assign-collaboration.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<script src="../_static/js/theme.js"></script>
3131
<link rel="index" title="索引" href="../genindex.html" />
3232
<link rel="search" title="搜索" href="../search.html" />
33-
<link rel="next" title="Assignment 0 - Kernel API" href="assign0-kernel-api.html" />
33+
<link rel="next" title="作业 0——内核 API" href="assign0-kernel-api.html" />
3434
<link rel="prev" title="SO2 实验 12——内核分析" href="lab12-kernel-profiling.html" />
3535
</head>
3636

@@ -91,7 +91,7 @@
9191
<li class="toctree-l3"><a class="reference internal" href="#section-6">6. 合并工作</a></li>
9292
</ul>
9393
</li>
94-
<li class="toctree-l2"><a class="reference internal" href="assign0-kernel-api.html">Assignment 0 - Kernel API</a></li>
94+
<li class="toctree-l2"><a class="reference internal" href="assign0-kernel-api.html">作业 0——内核 API</a></li>
9595
<li class="toctree-l2"><a class="reference internal" href="assign1-kprobe-based-tracer.html">Assignment 1 - Kprobe based tracer</a></li>
9696
<li class="toctree-l2"><a class="reference internal" href="assign2-driver-uart.html">Assignment 2 - Driver UART</a></li>
9797
<li class="toctree-l2"><a class="reference internal" href="assign3-software-raid.html">Assignment 3 - Software RAID</a></li>
@@ -295,7 +295,7 @@ <h2>6. 合并工作<a class="headerlink" href="#section-6" title="永久链接
295295
</div>
296296
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
297297
<a href="lab12-kernel-profiling.html" class="btn btn-neutral float-left" title="SO2 实验 12——内核分析" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
298-
<a href="assign0-kernel-api.html" class="btn btn-neutral float-right" title="Assignment 0 - Kernel API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
298+
<a href="assign0-kernel-api.html" class="btn btn-neutral float-right" title="作业 0——内核 API" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
299299
</div>
300300

301301
<hr/>

0 commit comments

Comments
 (0)