Skip to content

Commit 07731e7

Browse files
authored
Merge pull request #131 from cuishuang/main
fix some typos
2 parents 058ce32 + 2f7e3f3 commit 07731e7

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

source/chapter3/3multiprogramming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,6 @@
414414

415415
因此,我们显式在启动栈上分配了一个名为 ``_unused`` 的任务上下文,并将它的地址作为第一个参数传给 ``__switch`` ,这样保存一些寄存器之后的启动栈栈顶的位置将会保存在此变量中。然而无论是此变量还是启动栈我们之后均不会涉及到,一旦应用开始运行,我们就开始在应用的用户栈和内核栈之间开始切换了。这里声明此变量的意义仅仅是为了避免覆盖到其他数据。
416416

417-
我们的“始初龙”协作式操作系统就算是实现完毕了。它支持把多个应用的代码和数据放置到内存中;并能够执行每个应用;在应用程序发出 ``sys_yeild`` 系统调用时,能切换应用,从而让 CPU 尽可能忙于每个应用的计算任务,提高了任务调度的灵活性和 CPU 的使用效率。但“始初龙”协作式操作系统中任务调度的主动权在于应用程序的“自觉性”上,操作系统自身缺少强制的任务调度的手段,下一节我们将开始改进这方面的问题。
417+
我们的“始初龙”协作式操作系统就算是实现完毕了。它支持把多个应用的代码和数据放置到内存中;并能够执行每个应用;在应用程序发出 ``sys_yield`` 系统调用时,能切换应用,从而让 CPU 尽可能忙于每个应用的计算任务,提高了任务调度的灵活性和 CPU 的使用效率。但“始初龙”协作式操作系统中任务调度的主动权在于应用程序的“自觉性”上,操作系统自身缺少强制的任务调度的手段,下一节我们将开始改进这方面的问题。
418418

419419
.. [#eoraptor] 始初龙(也称始盗龙)是后三叠纪时期的两足食肉动物,也是目前所知最早的恐龙,它们只有一米长,却代表着恐龙的黎明。

source/chapter3/4time-sharing-system.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ RISC-V 的中断可以分成三类:
300300
它的功能是等待 3000ms 然后退出。可以看出,我们会在循环里面 ``yield_`` 来主动交出 CPU 而不是无意义的忙等。其实,现在的抢占式调度会在它循环 10ms 之后切换到其他应用,这样能让内核给其他应用分配更多的 CPU 资源并让它们更早运行结束。
301301

302302

303-
我们的“腔骨龙”协作式操作系统就算是实现完毕了。它支持把多个应用的代码和数据放置到内存中;并能够执行每个应用;在应用程序发出 ``sys_yeild`` 系统调用时,协作式地切换应用;并能通过时钟中断来实现抢占式调度并强行切换应用,从而提高了应用执行的灵活性、公平性和交互效率。
303+
我们的“腔骨龙”协作式操作系统就算是实现完毕了。它支持把多个应用的代码和数据放置到内存中;并能够执行每个应用;在应用程序发出 ``sys_yield`` 系统调用时,协作式地切换应用;并能通过时钟中断来实现抢占式调度并强行切换应用,从而提高了应用执行的灵活性、公平性和交互效率。
304304

305305
.. note::
306306

source/chapter4/3sv39-implementation-1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ SV39 多级页表的硬件机制
8484
#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
8585
pub struct VirtPageNum(pub usize);
8686
87-
.. _term-type-convertion:
87+
.. _term-type-conversion:
8888

89-
上面分别给出了物理地址、虚拟地址、物理页号、虚拟页号的 Rust 类型声明,它们都是 Rust 的元组式结构体,可以看成 usize 的一种简单包装。我们刻意将它们各自抽象出不同的类型而不是都使用与RISC-V 64硬件直接对应的 usize 基本类型,就是为了在 Rust 编译器的帮助下,通过多种方便且安全的 **类型转换** (Type Convertion) 来构建页表。
89+
上面分别给出了物理地址、虚拟地址、物理页号、虚拟页号的 Rust 类型声明,它们都是 Rust 的元组式结构体,可以看成 usize 的一种简单包装。我们刻意将它们各自抽象出不同的类型而不是都使用与RISC-V 64硬件直接对应的 usize 基本类型,就是为了在 Rust 编译器的帮助下,通过多种方便且安全的 **类型转换** (Type Conversion) 来构建页表。
9090

9191
首先,这些类型本身可以和 usize 之间互相转换,以物理地址 ``PhysAddr`` 为例,我们需要:
9292

source/chapter7/3cmdargs-and-redirection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ sys_exec 将命令行参数压入用户栈
327327
assert!(argc == 2);
328328
let fd = open(argv[1], OpenFlags::RDONLY);
329329
if fd == -1 {
330-
panic!("Error occured when opening file");
330+
panic!("Error occurred when opening file");
331331
}
332332
let fd = fd as usize;
333333
let mut buf = [0u8; 16];

source/chapter7/5answer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
// wait until the parent signals that the data is ready
9595
// WARNING: this is not the correct way to synchronize processes
9696
// on SMP systems due to memory orders, but this implementation
97-
// is choosen here specifically for ease of understanding
97+
// is chosen here specifically for ease of understanding
9898
}
9999
printf("%s", shm + 1);
100100
} else {

source/chapter8/1thread.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@
119119
120120
struct TaskContext {
121121
// 15 u64
122-
x1: u64, //ra: return addres,即当前正在执行线程的当前指令指针(PC)
122+
x1: u64, //ra: return address,即当前正在执行线程的当前指令指针(PC)
123123
x2: u64, //sp
124124
x8: u64, //s0,fp
125125
x9: u64, //s1
126126
x18: u64, //x18-27: s2-11
127127
x19: u64,
128128
...
129129
x27: u64,
130-
nx1: u64, //new return addres, 即下一个要执行线程的当前指令指针(PC)
130+
nx1: u64, //new return address, 即下一个要执行线程的当前指令指针(PC)
131131
}
132132
133133

source/terminology.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@
356356
- Page Offset
357357
- :ref:`实现 SV39 多级页表机制(上) <term-page-offset>`
358358
* - 类型转换
359-
- Type Convertion
360-
- :ref:`实现 SV39 多级页表机制(上) <term-type-convertion>`
359+
- Type Conversion
360+
- :ref:`实现 SV39 多级页表机制(上) <term-type-conversion>`
361361
* - 字典树
362362
- Trie
363363
- :ref:`实现 SV39 多级页表机制(上) <term-trie>`

0 commit comments

Comments
 (0)