The floppy controller's Digital Output Register (DOR) is a read/writeable
8 bit register. Amongst other things, this register allows the guest to
reset the floppy controller ("nRESET" bit 0x8) and to enable/disable the
use of the controller's IRQ line ("IRQ" bit 0x4). Note that the "nRESET"
bit is negated ("not RESET").
The floppy controller is expected to raise an IRQ when exiting the RESET
state, meaning when the guest changes the nRESET bit from 0 to 1.
That is what is currently done in the DOR write handler in floppy.js.
But the floppy controller is also expected to raise IRQs only if the IRQ
bit in DOR is set, and this was not considered in the DOR write handler.
This commit changes the DOR write handler to raise the IRQ only if the
IRQ bit is also set in the new DOR value received from the guest.
There was an overlap in the PCI space register declarations of the Floppy and the IDE controller. Since the conflicting registers were used exclusively by the two controllers this was fine, but 9front prints out this boot warning message:
ioalloc: 3f0 - 3f5 floppy: clashes with: 3f4 - 3f5 PCI.0.31.0
Note that "PCI.0.31.0" is our IDE controller (with pci_id 0x1f).
Problem: IDE actually uses only register address 0x3f6, but declared BAR1 for address range 0x3f4-0x3f7 which overlaps with the Floppy controller (the same with BAR3 and its address range of 0x374-0x377, but there was no overlap with other devices here).
Fix:
- changed BAR1 base address from 0x3f4 to 0x3f6 and its size from 4 to 1
- changed BAR3 base address from 0x374 to 0x376 and its size from 4 to 1
This commit fixes that problem and the 9front boot message from above.
Adds support to eject a CD from within Windows 95 through the context menu of the CD icon.
Before this commit eject was only supported externally through the v86 API.
A few ATAPI commands did not return an error (CD Not Ready condition) with ejected medium as specified in MMC-3 (https://www.t10.org/ftp/t10/document.97/97-108r0.pdf).
Adding these to our subset of ATAPI commands improved the FreeDOS 1.4 situation around eject/insert a bit (the problem really is eject, insert always works given the medium is ejected). Waiting around 20-30 sec after eject seems to work reliably.
The minor change from yesterday changed Win95's behaviour such that it now issues an ATAPI command ("PAUSE") that wasn't implemented yet which led to Win95 crashing in v86 Debug mode. Added that command and now it works again.
- changed cdrom and hda to point to the drive's IDEInterface instead of its parent IDEChannel
- added boolean method IDEInterface.has_disk() to query whether a Compact Disk is inserted or not
- the IDEController object and the CD-ROM device are now created unconditionally
Debug log messages in ide.js are currently at maximum granularity and emitted at a very high volume.
Under rare conditions this output can be very useful, else it clutters the view and makes comprehension of and reasoning about the runtime behaviour too challenging.
Changes:
- Erros and warnings are always logged, as well as important IDE state-related messages.
- Debug log messages are now split into 5 categories, 4 of them (the highly specific and also high-frequency ones) are optional and by default disabled.
- The 4 optional categories are REG_IO (log messages related to register I/O), IRQ, RW (read/write data) and RW_DMA (read/write data with DMA).
- ATA/ATAPI commands are always logged unless they fall into one of the 4 optional categories.
- Commands are logged with their name and including the full register state before and after command execution (input and output arguments).
Normal debug log output (with all 4 optional categories disabled, the default) is now mostly reduced to the actual ATA/ATAPI command flow with input/output command arguments, enough so that it's much easier to understand what happens.
The 4 optional debug categories can only be enabled programmatically in ide.js, they are meant to be used in advanced debugging sessions.