Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 19, 2025
Merged

Conversation

ghaerr
Copy link
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