From 51c5bc489303268da238f8e009e7990d287f0c17 Mon Sep 17 00:00:00 2001 From: Larry Kim Date: Sun, 3 Apr 2016 06:20:43 +0900 Subject: [PATCH] Help readers not to confuse with segment addr and phy addr and a minor typo --- Booting/linux-bootstrap-1.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Booting/linux-bootstrap-1.md b/Booting/linux-bootstrap-1.md index d41ecb9..2947e42 100644 --- a/Booting/linux-bootstrap-1.md +++ b/Booting/linux-bootstrap-1.md @@ -313,6 +313,7 @@ Here we can see a `jmp` instruction opcode - `0xeb` to the `start_of_setup-1f` p Actually this is the first code that runs (aside from the previous jump instruction of course). After the kernel setup got the control from the bootloader, the first `jmp` instruction is located at `0x200` (first 512 bytes) offset from the start of the kernel real mode. This we can read in the Linux kernel boot protocol and also see in the grub2 source code: ```C +segment = grub_linux_real_target >> 4; state.gs = state.fs = state.es = state.ds = state.ss = segment; state.cs = segment + 0x20; ``` @@ -324,7 +325,7 @@ gs = fs = es = ds = ss = 0x1000 cs = 0x1020 ``` -in my case when the kernel is loaded at `0x10000`. +In my case when the kernel is loaded at `0x10000`. After the jump to `start_of_setup`, it needs to do the following: