1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

Kernel: Unmap first MB after jumping above 3GB

This commit is contained in:
etaIneLp 2020-05-25 17:58:49 -04:00 committed by Andreas Kling
parent 826dc94187
commit 82d0352a67

View file

@ -151,7 +151,6 @@ start:
/* identity map the 0 to 2MB range */ /* identity map the 0 to 2MB range */
movl $512, %ecx movl $512, %ecx
movl $(boot_pd0_pt0 - 0xc0000000), %edi movl $(boot_pd0_pt0 - 0xc0000000), %edi
/*movl $0x100000, %eax*/
xorl %eax, %eax xorl %eax, %eax
1: 1:
@ -203,6 +202,16 @@ start:
movl %cr3, %eax movl %cr3, %eax
movl %eax, %cr3 movl %eax, %cr3
/* unmap the 0-1MB range, which isn't used after jmp-ing up here */
movl $256, %ecx
movl $(boot_pd0_pt0 - 0xc0000000), %edi
xorl %eax, %eax
1:
movl %eax, 0(%edi)
addl $8, %edi
loop 1b
/* set up initial stack and jump into C++ land */ /* set up initial stack and jump into C++ land */
mov $stack_top, %esp mov $stack_top, %esp
and $-16, %esp and $-16, %esp