mirror of
https://github.com/0xAX/linux-insides.git
synced 2025-01-03 04:10:56 +00:00
Merge pull request #364 from relip/patch-1
bootstrap-1: help readers not to confuse segment and physical address
This commit is contained in:
commit
556a2d3c4d
@ -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:
|
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
|
```C
|
||||||
|
segment = grub_linux_real_target >> 4;
|
||||||
state.gs = state.fs = state.es = state.ds = state.ss = segment;
|
state.gs = state.fs = state.es = state.ds = state.ss = segment;
|
||||||
state.cs = segment + 0x20;
|
state.cs = segment + 0x20;
|
||||||
```
|
```
|
||||||
@ -324,7 +325,7 @@ gs = fs = es = ds = ss = 0x1000
|
|||||||
cs = 0x1020
|
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:
|
After the jump to `start_of_setup`, it needs to do the following:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user