copy / copy/v86

Missing PAM write protection corrupts the VGA BIOS during Windows 98 shutdown

Open
#1,635 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
23.5k
Forks
1.9k
Avg merge
2d 14h
Merged PRs (30d)
7

Description

After installing [VMDisp9x](https://github.com/JHRobotics/vmdisp9x/releases/download/v1.2025.0.119/vmdisp9x-1.2025.0.119b-driver-2d.img) in Windows 98 SE, shutting down leaves a black screen with the CPU busy. Pressing a key makes CPU usage drop, but forcing a restart then runs ScanDisk because Windows did not shut down correctly.

During shutdown, the VGA BIOS clears `B8000–BFFFF`. This triggers Windows VDD's page-fault handling, which ends up overwriting `C0000–C7FFF`. `PAM1=0x11` makes that shadow RAM read-only, but [the code](https://github.com/copy/v86/blob/d96be774e549a83371b038b86e819804c96b921f/src/pci.js#L343) saves this value without protecting the memory. The VGA BIOS gets overwritten with `0x0720` text cells and shutdown never completes.

Honoring the PAM write-enable bits fixes it. [The slop86 fix](https://github.com/jlxip/slop86/commit/48bbf2e265ef07558a588c69d1adf2edba75ab41).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/pci.js around the linked line where PAM1 is saved, then compare the linked slop86 fix. Reproduce the Windows 98 SE shutdown failure with the VMDisp9x driver and verify that honoring the PAM write-enable bits prevents the VGA BIOS range from being overwritten and allows shutdown to complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.