[setup] Add 80386+ CPU testing to cputest.S #2089
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofSETUP_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.