From ad33bb165bf8ddc947cf99ca18fa37248755819e Mon Sep 17 00:00:00 2001 From: Dongliang Mu Date: Fri, 1 Sep 2023 19:44:56 +0800 Subject: [PATCH] modify to the right instruction and revise the description --- Booting/linux-bootstrap-1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Booting/linux-bootstrap-1.md b/Booting/linux-bootstrap-1.md index 2356874..25e6d6f 100644 --- a/Booting/linux-bootstrap-1.md +++ b/Booting/linux-bootstrap-1.md @@ -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` 段寄存器的值和其他段寄存器一致: