Skip to content
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

[setup] Add 80386+ CPU testing to cputest.S #2089

Merged
merged 3 commits into from
Oct 31, 2024
Merged

[setup] Add 80386+ CPU testing to cputest.S #2089

merged 3 commits into from
Oct 31, 2024

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Oct 31, 2024

Requested by @Mellvik in Mellvik/TLVC#97 (comment) as a means for a quick "fast system" check with which to disable floppy disk caching in the DF driver in the future.

Adds 32-bit CPU test from working XMS 32-bit CPU check to setup's cputest.S, which saves the processor type (arch_cpu) in SETUP_CPU_TYPE (setupb(0x20)).

Note that arch_cpu isn't a global in a previous effort to remove specific CPU tests from the kernel. This means probably best to use SETUP_CPU_TYPE == 7 for the presence of a 386 or later CPU. Note that unfortunately due to constant selection long ago, the use of SETUP_CPU_TYPE >= 7 is a bad idea (and still used in setup_arch() for setting SYS_CAPS) because arch_cpu type of 255 is Unknown, which out to be zero, except that's the value for 8088.

This PR also fixes what looked like incorrect handling of CPU testing when CONFIG_ROMCODE is set, but is untested.

Also, it was discovered that cputest.S enabled interrupts after calling, which is prohibited during setup. This apparently can't be avoided for some CPU tests, but interrupts are disabled again at the end of the cputest routine, as the kernel is expected to be started with interrupts disabled for safety reasons.

Tested on QEMU but not real hardware.

@ghaerr ghaerr merged commit 2d59813 into master Oct 31, 2024
1 check passed
@ghaerr ghaerr deleted the cputest branch October 31, 2024 01:11
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