Skip to content

Commit 751479f

Browse files
committed
ops, overwrote bootloader with pagetables, put them at 0x70000 - 0x73FFF
1 parent f4b7c8a commit 751479f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

kernel/asm/startup-x86_64.asm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
startup_arch:
44
cli
55
; setting up Page Tables
6-
; Identity Mapping first 512GB
7-
mov ax, 0x500
6+
; Identity Mapping first GB
7+
mov ax, 0x7000
88
mov es, ax
99

1010
xor edi, edi
@@ -15,12 +15,12 @@ startup_arch:
1515

1616
xor edi, edi
1717
;Link first PML4 to PDP
18-
mov DWORD [es:edi], 0x6000 | 1 << 1 | 1
18+
mov DWORD [es:edi], 0x71000 | 1 << 1 | 1
1919
add edi, 0x1000
2020
;Link first PDP to PD
21-
mov DWORD [es:edi], 0x7000 | 1 << 1 | 1
21+
mov DWORD [es:edi], 0x72000 | 1 << 1 | 1
2222
add edi, 0x1000
23-
;Link all PD's (512 per PDP) to 1 GB of memory
23+
;Link all PD's (512 per PDP, 2MB each)y
2424
mov ebx, 1 << 7 | 1 << 1 | 1
2525
mov ecx, 512
2626
.setpd:
@@ -33,7 +33,7 @@ startup_arch:
3333
mov es, ax
3434

3535
;cr3 holds pointer to PML4
36-
mov edi, 0x5000
36+
mov edi, 0x70000
3737
mov cr3, edi
3838

3939
;enable Page Address Extension and Page Size Extension

0 commit comments

Comments
 (0)