Delay floppy READ ID completion
- Dominant language
- JavaScript
- Stars
- 23.5k
- Forks
- 1.9k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
Insert a floppy image like [this one](https://github.com/JHRobotics/vmdisp9x/releases/download/v1.2025.0.119/vmdisp9x-1.2025.0.119b-driver-2d.img) in Windows 98 SE. Just clicking the `A:` drive in My Computer causes repeated stalls of ~7.5 seconds.
This happens because [`exec_read_id` raises IRQ6 synchronously](https://github.com/copy/v86/blob/master/src/floppy.js#L756) before Windows has set its interrupt-wait flag. The handler rejects the interrupt, leaving the result unread until the driver times out and resets the controller. This happens with JIT disabled too.
Delaying completion by just 1 ms solves it, but [QEMU uses 20 ms](https://github.com/qemu/qemu/blob/master/hw/block/fdc.c#L1961-L1971).
You can check the [slop86 fix](https://github.com/jlxip/slop86/commit/4ba36fda53cc71b4ff32c582bc75c5c15597f347).
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/floppy.js at exec_read_id, where the issue reports that IRQ6 is raised synchronously before Windows 98 has set its interrupt-wait flag. Compare the timing approaches linked from QEMU and the slop86 fix, then verify that opening the A: drive with the supplied floppy image no longer causes repeated ~7.5-second stalls, including with JIT disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100