Fix triple-fault when starting APs with program loaded above 16MB (issue #63).

In a .code16 section, the default coding for the lgdt instruction only loads
a 24 bit base address from the GDT descriptor. When loaded above 16MB, we
need it to load the full 32 bits.
This commit is contained in:
Martin Whitaker 2022-05-15 10:10:36 +01:00
parent f98ceb1613
commit f16be176ed
2 changed files with 2 additions and 2 deletions

View File

@ -744,7 +744,7 @@ ap_trampoline:
movl %edi, %eax
addl $(gdt - startup), %eax
movl %eax, (ap_gdt_descr - ap_trampoline + 2)
lgdt ap_gdt_descr - ap_trampoline
data32 lgdt ap_gdt_descr - ap_trampoline
# Switch to protected mode and reload the segment registers.

View File

@ -556,7 +556,7 @@ ap_trampoline:
movl %ebx, %eax
addl $(gdt - startup), %eax
movl %eax, (ap_gdt_descr - ap_trampoline + 2)
lgdt ap_gdt_descr - ap_trampoline
data32 lgdt ap_gdt_descr - ap_trampoline
# Set the page directory base address.