EFI: Initialize/load the GDT.
Signed-off-by: Jessica Hamilton <[email protected]>
This commit is contained in:
committed by
Jessica Hamilton
parent
b3215a6275
commit
34a6dd6728
@@ -27,9 +27,12 @@ FUNCTION(efi_enter_kernel):
|
|||||||
|
|
||||||
// Load 64-bit enabled GDT
|
// Load 64-bit enabled GDT
|
||||||
lgdtq long_gdtr(%rip)
|
lgdtq long_gdtr(%rip)
|
||||||
/*
|
|
||||||
// Jump into the 64-bit code segment.
|
// 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
|
.align 8
|
||||||
.code64
|
.code64
|
||||||
.Llmode:
|
.Llmode:
|
||||||
@@ -41,7 +44,7 @@ FUNCTION(efi_enter_kernel):
|
|||||||
mov %ax, %es
|
mov %ax, %es
|
||||||
mov %ax, %fs
|
mov %ax, %fs
|
||||||
mov %ax, %gs
|
mov %ax, %gs
|
||||||
*/
|
|
||||||
// Set the stack pointer.
|
// Set the stack pointer.
|
||||||
movq %rdx, %rsp
|
movq %rdx, %rsp
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ long_gdt_init()
|
|||||||
DPL_USER);
|
DPL_USER);
|
||||||
|
|
||||||
// Used by long_enter_kernel().
|
// Used by long_enter_kernel().
|
||||||
gLongGDT = fix_address((addr_t)gBootGDT);
|
gLongGDT = (addr_t)gBootGDT + 0xFFFFFF0000000000;
|
||||||
dprintf("GDT at 0x%lx\n", gLongGDT);
|
dprintf("GDT at 0x%lx\n", gLongGDT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user