summaryrefslogtreecommitdiff
path: root/Kernel/Arch/i386/Boot
diff options
context:
space:
mode:
authoretaIneLp <smallfry2006@yahoo.com>2020-05-25 17:58:49 -0400
committerAndreas Kling <kling@serenityos.org>2020-05-26 09:50:12 +0200
commit82d0352a67830eaa710804e674713874444d8ba7 (patch)
tree5aa7e433ae12390d6ca07d24f31d8bb22fe50cf4 /Kernel/Arch/i386/Boot
parent826dc9418799d0488002a13448f5a48d62f31a31 (diff)
downloadserenity-82d0352a67830eaa710804e674713874444d8ba7.zip
Kernel: Unmap first MB after jumping above 3GB
Diffstat (limited to 'Kernel/Arch/i386/Boot')
-rw-r--r--Kernel/Arch/i386/Boot/boot.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/Kernel/Arch/i386/Boot/boot.S b/Kernel/Arch/i386/Boot/boot.S
index 9289cb5a5f..601a50a7ac 100644
--- a/Kernel/Arch/i386/Boot/boot.S
+++ b/Kernel/Arch/i386/Boot/boot.S
@@ -151,7 +151,6 @@ start:
/* identity map the 0 to 2MB range */
movl $512, %ecx
movl $(boot_pd0_pt0 - 0xc0000000), %edi
- /*movl $0x100000, %eax*/
xorl %eax, %eax
1:
@@ -203,6 +202,16 @@ start:
movl %cr3, %eax
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 */
mov $stack_top, %esp
and $-16, %esp