v86: fix windowed DOS box clobbering VBE; add DOS-box probe scenario#359
Merged
Conversation
Rebuilds libv86.js from felixrieseberg/v86@windows95-base, which now carries vga-defer-vbe-disable-v86: when a windowed DOS VM's vgabios writes dispi[4]=0, Win9x's VDD passes that through (it doesn't know about ports 1CE/1CF) while virtualising the rest of the mode-set, so v86 used to drop out of LFB rendering with the legacy registers still holding SVGA values and the screen turned to planar garbage. The fix defers the disable until a legacy attribute-mode write actually reaches the hardware. debug-harness: WIN95_PROBE_DOSBOX=1 opens command from Run, types dir, optionally Alt+Enters (WIN95_PROBE_DOSBOX_ALTENTER=1). WIN95_PROBE_VGATRACE=1 wraps the VGA io.ports[] entries (not the VGAScreen methods, which are captured by-value at registration) and dumps [port, op, value, eip+VM/PE/CPL] tuples to /tmp/win95-vgatrace.json — that EIP/mode column is what pinned the leak on V86-mode vgabios at C000:2C8x.
61dd6d0 to
26525f6
Compare
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.
What
Rebuilds
libv86.jsfromfelixrieseberg/v86@windows95-base, which now carries thevga-defer-vbe-disable-v86fix.Why
Opening any MS-DOS program turned the screen into vertical planar-garbage stripes. Root cause: the windowed DOS VM's
INT 10hreflects to vgabios in V86 mode; vgabios's mode-set begins by writingdispi[4]=0. Win9x's VDD virtualises the standard VGA ports (3B0–3DF) for windowed VMs but passes 1CE/1CF straight through, so the VBE-disable reaches the hardware while the rest of the mode-set is captured into the VM's virtual register file. v86 then dropped out of LFB rendering with the legacy registers still holding the SVGA values.The v86 fix defers clearing
svga_enabledwhendispi[4]is cleared from V86 mode (EFLAGS.VMset) until a legacyattribute_modewrite actually reaches the hardware — which a real passthrough mode-set does on the very next register, but the windowed-VM leak never does.Also
debug-harness.ts: newWIN95_PROBE_DOSBOX=1scenario (opencommand, typedir, optionallyWIN95_PROBE_DOSBOX_ALTENTER=1to fullscreen) — this is the regression test.WIN95_PROBE_VGATRACE=1: opt-in VGA I/O tracer that wrapsio.ports[](not theVGAScreen.portXXX_writemethods, which are captured by-value at registration) and dumps[port, op, value, "eip VMPE cplN"]tuples to/tmp/win95-vgatrace.json. The EIP+CPU-mode column is what pinned the leak on V86-mode vgabios atC000:2C8x.Verified
diroutput visibletools/probe-boot.sh: 2/3 SUCCESS, 1 FAIL_VXDLINK (matches pre-fix baseline)Upstream PR for the v86 side will be opened separately from
felixrieseberg/v86:vga-defer-vbe-disable-v86.