aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianhao Wang <shrik3@mailbox.org>2024-05-02 02:26:17 +0200
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:17:10 +0200
commita1a3d1d5b6dcee409eb57d8c9fa354a4a40f10e3 (patch)
tree57df9099a70b10c9c361dfd6146f20677daa3115
parent77cb397cc1603d2650c1730d01bec95dcc8c37f8 (diff)
chore
-rw-r--r--boot/startup-x86_64.s13
1 files changed, 7 insertions, 6 deletions
diff --git a/boot/startup-x86_64.s b/boot/startup-x86_64.s
index 4f115e9..448576a 100644
--- a/boot/startup-x86_64.s
+++ b/boot/startup-x86_64.s
@@ -12,7 +12,7 @@ MAX_MEM: equ 512
[GLOBAL pml4]
[GLOBAL pdp]
-; functions from the other parts
+; functions from other parts of rustubs
[EXTERN vectors_start]
[EXTERN idt]
[EXTERN idt_descr]
@@ -49,9 +49,9 @@ init_longmode:
mov cr4, eax
setup_paging:
- ; Provisional identical page mapping, using 1G huge page (therefore only 2 table
- ; levels needed)
- ;
+ ; Provisional identical page mapping, using 1G huge page, therefore only 2
+ ; table levels needed. see docs/x86_paging.txt
+
; PML4 (Page Map Level 4 / 1st level)
mov eax, pdp
or eax, 0xf
@@ -77,7 +77,8 @@ fill_tables2_done:
mov cr3, eax
activate_long_mode:
; activate Long Mode (for now in compatibility mode)
- mov ecx, 0x0C0000080 ; select EFER (Extended Feature Enable Register)
+ ; select EFER (Extended Feature Enable Register)
+ mov ecx, 0x0C0000080
rdmsr
or eax, 1 << 8 ; LME (Long Mode Enable)
wrmsr
@@ -158,7 +159,7 @@ gdt_80:
[SECTION .bss]
- global init_stack:data (init_stack.end - init_stack)
+global init_stack:data (init_stack.end - init_stack)
init_stack:
resb STACKSIZE
.end: