Skip to content

DOS: fix int08 stack for DPMI mode.#27

Open
crazii wants to merge 1 commit into
ijsf:masterfrom
crazii:master
Open

DOS: fix int08 stack for DPMI mode.#27
crazii wants to merge 1 commit into
ijsf:masterfrom
crazii:master

Conversation

@crazii

@crazii crazii commented May 19, 2026

Copy link
Copy Markdown

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:

mov edi, ebp
...
stosb 

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.).

@crazii crazii closed this May 19, 2026
@crazii crazii reopened this May 19, 2026
@crazii

crazii commented May 19, 2026

Copy link
Copy Markdown
Author

Sorry closing the PR was a mistaking operation.

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