VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

When a floppy disk interrupt occurs, is there a difference between the Sense Interrupt command and the result phase of commands?

Normally, I'd assume that the result phase is going to become active at that point for commands that have one triggered by an interrupt(e.g. Read/Read ID/Write/Verify etc.).
And of course the commands with interrupts without result phase use Sense Interrupt instead to report it's result?

Would that be correct behaviour?

And writing to the Data register clears the IRQ(while keeping tabs on it for the Sense Interrupt command)? As well as a reset(which also clears the IRQ and Sense Interrupt being valid)?

http://www.isdaman.com/alsos/hardware/fdc/floppy.htm is a bit confusing on that matter:

Details

Check Interrupt Status (x8h)
image of Check Interrupt Status Command

This command is used to check status infromation about the state of the controller in the result phase when the controller has returned an interrupt.

The interrupt signal is reset by this command, which also determines the source of the interrupt via status register ST0. If the command is issued with no interrupts pending, a value of 80h is returned in ST0, corresponding to the message invalid command .

Interrupts are issued in the following cases:

At the beginning of the result phase of the commands:
read sector
read deleted sector
write sector
write deleted sector
read track
format track
read sector ID
verify

After completion of the following commands without a result phase:
calibrate drive
seek
seek relative

For data exchange between main memory and controller when interrupt-driven data exchange
is active and the controller is not using DMA.

Or does that mean that an interrupt is thrown for those commands, you then read the result from the controller, then after that issue a Sense Interrupt command to clear the IRQ?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 3, by superfury

User metadata
Rank l33t++
Rank
l33t++

What about reads to the data port? Do they lower it as well(e.g. start to read the result bytes, or even the data bytes the interrupt was raised for(in NDMA mode)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 3, by superfury

User metadata
Rank l33t++
Rank
l33t++

Hmmm... Interesting: https://groups.google.com/d/msg/comp.os.minix … Q4/zem3N-DX4mEJ

So, it's lowered for:
- result phase reads (for all commands with Read/Write/Format/Scan in their name only)
- successful Sense Interrupt status
- byte i/o for the buffer in non-DMA mode(execution phase byte).

I've implemented those now(instead of only on all writes(and more recently commits on reads as well)). In all other cases, it's left alone(left at whatever it was before the read/write to the data register).

Also, on ready state(line?) change(eject/insert) an IRQ is generated? Anyone knows more about this? Isn't the drive always supposed to be 'ready' (the ST0 ready bit?)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io