EFI: Initialize/load the GDT.

Signed-off-by: Jessica Hamilton <[email protected]>
This commit is contained in:
Henry Harrington
2016-11-14 00:59:59 +13:00
committed by Jessica Hamilton
parent b3215a6275
commit 34a6dd6728
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -27,9 +27,12 @@ FUNCTION(efi_enter_kernel):
// Load 64-bit enabled GDT
lgdtq long_gdtr(%rip)
/*
// Jump into the 64-bit code segment.
ljmp $KERNEL_CODE_SELECTOR, $.Llmode
push $KERNEL_CODE_SELECTOR
lea .Llmode(%rip), %rax
push %rax
lretq
.align 8
.code64
.Llmode:
@@ -41,7 +44,7 @@ FUNCTION(efi_enter_kernel):
mov %ax, %es
mov %ax, %fs
mov %ax, %gs
*/
// Set the stack pointer.
movq %rdx, %rsp
+1 -1
View File
@@ -77,7 +77,7 @@ long_gdt_init()
DPL_USER);
// Used by long_enter_kernel().
gLongGDT = fix_address((addr_t)gBootGDT);
gLongGDT = (addr_t)gBootGDT + 0xFFFFFF0000000000;
dprintf("GDT at 0x%lx\n", gLongGDT);
}