Skip to content

Commit

Permalink
In the following expression, we add the value of phys_base to the
Browse files Browse the repository at this point in the history
rax register, not the address of phys_base.
addq    phys_base(%rip), %rax

BTW, the value of phys_base =
the actual loaded physical address of kernel after relocation - the
likned physical address of kernel.

Signed-off-by: Firo Yang <[email protected]>
  • Loading branch information
Firo Yang committed Nov 29, 2017
1 parent abf4f68 commit 723b076
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Initialization/linux-initialization-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ That's all for now. Our early paging is prepared and we just need to finish last
Last preparation before jump at the kernel entry point
--------------------------------------------------------------------------------

After that we jump to the label `1` we enable `PAE`, `PGE` (Paging Global Extension) and put the physical address of the `phys_base` (see above) to the `rax` register and fill `cr3` register with it:
After that we jump to the label `1` we enable `PAE`, `PGE` (Paging Global Extension) and put the content of the `phys_base` (see above) to the `rax` register and fill `cr3` register with it:

```assembly
1:
Expand Down
1 change: 1 addition & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,4 @@ Thank you to all contributors:
* [Cornelius Diekmann](https://github.com/diekmann)
* [Andrés Rojas](https://github.com/c0r3dump3d)
* [Beomsu Kim](https://github.com/0xF0D0)
* [Firo Yang](https://github.com/firogh)

0 comments on commit 723b076

Please sign in to comment.