VOGONS


First post, by superfury

User metadata
Rank l33t
Rank
l33t

When does a write command perform implied seek? Before or after the data transfer to disk?

What happens if the media is changed or removed while seeking during reads and writes?

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

Reply 1 of 5, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi! I don't know. But if you like to experiment with floppy drives,
you may also like to have a look at PC-Backup/PC-Restore of Central Point's PC Tools Deluxe 4.x.
It does some weird stuff with the floppy drive.
It detects the insertion of a floppy on its own, for example.
Anyway, this is just something I remember. Maybe I'm wrong. My memory isn't best anymore, some people say. 😅

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 2 of 5, by superfury

User metadata
Rank l33t
Rank
l33t

I just looked a bit further. In the 82077AA manual, it mentions that the implied seek is performed before a read or write command.
So if it's before a command, that means before the data phase/transfer starts.

I've also modified the read/write commands to perform an implied seek through normal timing mechanisms now! 😁
Previously it would just instantly change to the selected cylinder. Now it will simply use the normal seek mechanisms and timing, interrupting the read/write command until the seek completes.
Although it won't report the error correctly yet if the seek fails. That still needs to be implemented.
Edit: Just implemented the error handling of failed implicit seeks.

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

Reply 3 of 5, by Battler

User metadata
Rank Member
Rank
Member
superfury wrote:

When does a write command perform implied seek? Before or after the data transfer to disk?

Before. If implied seeks are enabled, when a READ SECTOR ID, READ TRACK, READ DATA, READ DELETED DATA, WRITE DATA, or WRITE DELETED DATA command is issued, the FDC compares the specified sector ID's cylinder (C) field to the current value of its physical cylinder number (PCN) register for the selected drive and if they do not match, it seeks to the specific cylinder.

Reply 4 of 5, by superfury

User metadata
Rank l33t
Rank
l33t
Battler wrote on Yesterday, 15:09:
superfury wrote:

When does a write command perform implied seek? Before or after the data transfer to disk?

Before. If implied seeks are enabled, when a READ SECTOR ID, READ TRACK, READ DATA, READ DELETED DATA, WRITE DATA, or WRITE DELETED DATA command is issued, the FDC compares the specified sector ID's cylinder (C) field to the current value of its physical cylinder number (PCN) register for the selected drive and if they do not match, it seeks to the specific cylinder.

Makes sense. And what should happen if the disk is changed (a different disk being inserted) before the seek completes (for example, in a paused emulator)? Does the FDC detect this and take a specific action on it? Error out in a specific way? So what happens during any seek, read or write (including formatting etc.) command when the disk is ejected during the command or when seeking (implied and not implied)?

Edit: After improving the floppy disk controller a bit (it reacting to read-only and disk changed bits during read/write/format), somehow the booting starts with C/H/S 0/1/1 instead of 0/0/1 on the i430fx? Weird?

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

Reply 5 of 5, by Battler

User metadata
Rank Member
Rank
Member

If the disk is ejected during seeking, the seek would complete without issues (the drive's step motor is still going to move the head), but the read command is not going obtain any data from the drive, and therefore most likely time out, which would cause DOS to report "Not ready reading drive A:".