modify to the right instruction and revise the description

This commit is contained in:
Dongliang Mu
2023-09-01 19:44:56 +08:00
parent 9593c784ac
commit ad33bb165b

View File

@@ -336,12 +336,12 @@ cs = 0x1020
段寄存器设置
--------------------------------------------------------------------------------
在代码的一开始,就`ds``es` 段寄存器的内容设置成一样,并且使用指令 `sti` 来允许中断发生
首先,内核保证`ds``es` 段寄存器指向相同地址,随后,使用 `cld` 指令来清理方向标志位
```assembly
movw %ds, %ax
movw %ax, %es
sti
cld
```
就像我在上面一节中所写的, 为了能够跳转到 `_start` 标号出执行代码grub2 将 `cs` 段寄存器的值设置成了 `0x1020`,这个值和其他段寄存器都是不一样的,因此下面的代码就是将 `cs` 段寄存器的值和其他段寄存器一致: