execute ltr in position where it doesnt fault
This commit is contained in:
@@ -198,6 +198,10 @@ paging_enable:
|
||||
; Load Long Mode Global Descriptor Table
|
||||
lgdt [gdt_long_mode_pointer]
|
||||
|
||||
;; Select 5th Segment in GDT. 5<<3 == 0x28
|
||||
;mov ax, 0x0028
|
||||
;ltr ax
|
||||
|
||||
; Far jump to the 64-bit start code
|
||||
jmp 0x8:long_mode_start
|
||||
|
||||
|
||||
@@ -16,9 +16,13 @@ extern "C" [[noreturn]] void kernel_init() {
|
||||
// Initialize PICs
|
||||
PIC::initialize();
|
||||
|
||||
// Call global constructors
|
||||
// Call global constructors
|
||||
CSU::initializer();
|
||||
|
||||
//Select 5th Segment in GDT. 5<<3 == 0x28
|
||||
asm volatile ("mov $0x28, %ax");
|
||||
asm("ltr %ax");
|
||||
|
||||
// Initialize ACPI
|
||||
if (!ACPI::init()) {
|
||||
DBG_VERBOSE << "No ACPI!";
|
||||
|
||||
Reference in New Issue
Block a user