[FREELDR] Do some MSVC fixes (#8454)

Ensure using the correct data segment in the lgdt/lidt invocation.
Also simplify the MASM/ML vs. gas syntax by using `lXdtPrefix`.

Fixes x86 MSVC FreeLoader boot following commit 9decadee83.
This commit is contained in:
Daniel Victor
2025-11-11 12:27:47 -03:00
committed by GitHub
parent bb7a6134c4
commit 70119785be

View File

@@ -95,11 +95,7 @@ inrmode:
mov sp, word ptr ds:[stack16]
/* Load IDTR with real mode value */
#ifdef _USE_ML
lidt fword ptr rmode_idtptr
#else
lidt rmode_idtptr
#endif
lidt lXdtPrefix ds:[rmode_idtptr]
sti /* These are ok now */
@@ -120,11 +116,7 @@ exit_to_protected:
mov word ptr ds:[stack16], sp
/* Load the GDT */
#ifdef _USE_ML
lgdt fword ptr gdtptr
#else
lgdt gdtptr
#endif
lgdt lXdtPrefix ds:[gdtptr]
/* Enable Protected Mode */
mov eax, cr0