DOS: fix int08 stack for DPMI mode.#27
Open
crazii wants to merge 1 commit into
Open
Conversation
Author
|
Sorry closing the PR was a mistaking operation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The DPMI spec requires a DPMI host to provide a locked protected mode stack for hardware interrupts. So after the interrupt handler changing DS/ES, DS equals ES, but SS is not. but the compiled code assume SS also equals DS (flat/small model). The crashed disassembly for timer_poll_proc_ptr looks like this:
Here EBP by default is using SS, but stos uses ES, thus cause a incorrect address.
This problem does not exist when no DPMI present, as the GO32v2 extender will provide a interrupt stack that uses program current DS. But it won't work with CWSDPMI.
After the fix, it should work with CWSDPMI and probably Windows too. And works with SBEMU. FYI SBEMU provides OPL3 emulation using modern sound cards (AC97, Intel HDA etc.).