execute ltr in position where it doesnt fault

This commit is contained in:
2025-11-23 21:06:14 +01:00
parent d0e6c1e607
commit a7b488f270
5 changed files with 20 additions and 14 deletions

View File

@@ -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

View File

@@ -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!";