summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86/x86_64
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-07-16 09:37:45 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-16 18:50:59 +0200
commitacf8f2a2a3894304fa7e9e48f4fb104b65298f12 (patch)
tree358715cc11a1d7f0ab5ece5b85f27709db79ed41 /Kernel/Arch/x86/x86_64
parent9b431cbe425d2fffcd3bfd0de8c33a6374f53ab1 (diff)
downloadserenity-acf8f2a2a3894304fa7e9e48f4fb104b65298f12.zip
Kernel: Support specifying a 64-bit KERNEL_BASE address
The kernel doesn't currently boot when using an address other than 0xc0000000 because the page tables aren't set up properly for that but this at least lets us build the kernel.
Diffstat (limited to 'Kernel/Arch/x86/x86_64')
-rw-r--r--Kernel/Arch/x86/x86_64/Boot/ap_setup.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/Arch/x86/x86_64/Boot/ap_setup.S b/Kernel/Arch/x86/x86_64/Boot/ap_setup.S
index b43f216a92..714642dd79 100644
--- a/Kernel/Arch/x86/x86_64/Boot/ap_setup.S
+++ b/Kernel/Arch/x86/x86_64/Boot/ap_setup.S
@@ -92,12 +92,16 @@ apic_ap_start32:
movl %eax, %cr0
/* load the temporary 64-bit gdt from boot that points above 3GB */
- lgdt gdt64ptr
+ mov $(gdt64ptr - KERNEL_BASE), %eax
+ lgdt (%eax)
/* jump above 3GB into our identity mapped area now */
ljmpl $code64_sel, $(apic_ap_start64 - apic_ap_start + 0xc0008000)
.code64
apic_ap_start64:
+ movabs $gdt64ptr, %rax
+ lgdt (%rax)
+
mov $0, %ax
mov %ax, %ss
mov %ax, %ds