Skip to content

[kernel] Use full protected mode entry when enabling unreal mode#2308

Merged
ghaerr merged 3 commits intomasterfrom
unreal
Apr 19, 2025
Merged

[kernel] Use full protected mode entry when enabling unreal mode#2308
ghaerr merged 3 commits intomasterfrom
unreal

Conversation

@ghaerr
Copy link
Copy Markdown
Owner

@ghaerr ghaerr commented Apr 18, 2025

When XMS is enabled, this PR adds by default a full protected mode entry/exit in order to set the segment cache registers, necessary on some 386 systems for XMS memory access for system buffers and the XMS ramdisk in the kernel.

Should a system not boot with XMS enabled, this can be turned off by setting USE_PROTMODE=0 in elks/arch/x86/lib/unreal.S, or by setting xms=off or leaving out any xms= line at all.

The method being used is based on @Mellvik's code, from his research and debugging on real hardware and extensively discussed in Mellvik/TLVC#161 and before that in Mellvik/TLVC#160 (comment).

The documentation of the definition of the Global Descriptor Table has been updated as well, since it was found incorrectly describing the requirement for code versus data segments in the GDT Access Descriptor Byte.

@ghaerr ghaerr merged commit 1beff73 into master Apr 19, 2025
1 check passed
@ghaerr ghaerr deleted the unreal branch April 19, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant