VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

How does a non-present slave 'respond' when only the master is present? I've implemented it as Bochs does, but the i440fx BIOS seems to take an extraordinarily amount of time to detect it before erroring out? The master is detected correctly, but the slave has an weirdly long delay before not being detected at all?

Also, after reboot from 'MS-DOS' (the orange text telling it's OK to shut down the computer when Windows 95 C/OSR 2.5 is shut down) the secondary master/slave aren't detected any more?

When no controller is present, UniPCemu will float the bus(returning 0xFF) for the status register.
With an non-present slave, it will read 0x00 from the status register instead (the master reads it's normal status register instead).

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

Reply 1 of 7, by Battler

User metadata
Rank Member
Rank
Member

Yes, 0x00 is correct for a slave where the master is present, as per my tests on real hardware. When the master is absent, however, both return 0xff* (or 0x7f on boards with bit 7 pulldown, which most later boards do).

* Actually, my tests showed noise being read rather than a stable floated bus readout.

However, there's the caveat that my tests were done on my old Pentium Dual-Core PC, so quite a bit newer than the 440FX era. It would be nice if someone tested this on hardware from the 90's.

Reply 2 of 7, by superfury

User metadata
Rank l33t++
Rank
l33t++

OK. So the slave's status register returns 0x00 with the 'master present, slave not present and slave selected' case, both master and slave giving 0xFF (or random, perhaps depending on the motherboard) if neither master nor slave are present. That's how the status register responds.

What about the other registers of the hard drive range (registers 0-5)? What do they report? I currently make both drives (having their own register state) have their own registers and report those always. Only when no controller is present (so neither master nor slave is present), report the value 0x00 in them. Otherwise, report stored value (writes succeed and can be read back as well (using their own storage for each master and slave addressed), even if the slave doesn't exist).

And what about register 6(the drive/head register)? Of course in the case where the master is present and the slave isn't, with the slave being selected. When neither master nor slave are present, it floats the bus when read. Writes are ignored in that case as well. When only a master is present, the slave reports it's own drive/head register, just as the CPU has written it (the master is acting on and storing the slave's registers beside it's own master registers?). Is that correct behaviour?

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

Reply 3 of 7, by Battler

User metadata
Rank Member
Rank
Member

Writes to register 6 are not ignored, at least for the drive select bit - that bit can always be written (but not read). If there's a slave without a master, and you select the slave, you're going to read noise from every port.

When the master is present but slave is not, the master speaks for the slave when the slave is selected.

Reply 5 of 7, by mkarcher

User metadata
Rank l33t
Rank
l33t
rasz_pl wrote on 2021-08-11, 15:35:

Michal Necasek investigated this some time ago and posted here: https://www.os2museum.com/wp/reading-from-void/

Summarizing the relevant point of that post: IDE interface boards should make sure that BSY appears clear if the drive doesn't actively pull it high. It does so by having a pull-down resistor on D7 on the IDE side of a bidirectional buffer chip between the ISA bus and the IDE cable.

Reply 7 of 7, by Battler

User metadata
Rank Member
Rank
Member
mkarcher wrote on 2021-08-11, 17:56:
rasz_pl wrote on 2021-08-11, 15:35:

Michal Necasek investigated this some time ago and posted here: https://www.os2museum.com/wp/reading-from-void/

Summarizing the relevant point of that post: IDE interface boards should make sure that BSY appears clear if the drive doesn't actively pull it high. It does so by having a pull-down resistor on D7 on the IDE side of a bidirectional buffer chip between the ISA bus and the IDE cable.

This varies from board to board. I have myself run into cases where one BIOS expects it to be pulled down, while another expects it to not be pulled down.