snufkin wrote on 2021-04-17, 11:39:
It could be that the Winbond chip is not very tolerant of locking on to the data stream from the drive, but that the National Semiconductor one on the Thinkpad can cope better. Could affect both drives if it's caused by some component ageing.
I feel like this is probably a violation of Occam's Razor...
snufkin wrote on 2021-04-17, 11:39:
nathana wrote on 2021-04-17, 07:18:
The drives probably expect PS/2-style signalling, and the PC floppy controller is doing AT-style signalling. If the floppy controller isn't pulling the right pins high or low, the drive may be interpreting it to mean the opposite of what the controller intended.
[...] I think the PS/2 mode that the Winbond chip supports is to do with the details about the FDC configuration registers, and doesn't change the underlying signalling to the drive hardware.
It is VERY hard to tell from the available docs. You could be correct, but as I lamented in another post to a different forum, one of my biggest frustrations has been the lack of CLEAR and UNAMBIGUOUS documentation in this regard.
snufkin wrote on 2021-04-17, 11:39:
It seems as though the way the FDC detects the density of a disk is by looking for various synchronization blocks (1 per sector I think), and syncing its clock to them (effectively the clock rate is embedded in the data). So I don't think there are any separate density signals from the drive back to the FDC.
That sounds like how SOME drives work. Many models of 3.5" HD drives actually include a microswitch right underneath the "density" hole that's located on the side of the diskette opposite the write-protect hole. My understanding is that the vast vast majority of drives intended for use with non-IBM systems "sense" media in this way (if switch is depressed, then it's DD media, but if not, it's HD) and then actually *signal this back to the controller*, and the vast vast majority of controllers in non-IBM systems are configured to look for that media sense signal from the drive. This is apparently in contrast to PS/2 systems, where most? all? 3.5" HD drives do *not* have a microswitch and the media in the drive is detected by BIOS as you described (which is much the same way that it is always done with 5.25" media both on IBM and non-IBM systems, I think).
So this goes back to my comment about ambiguous documentation, and unclear information. If you look up the docs for the NatSemi controller used in the 770, it at least is very clear that in addition to the 4 signal lines you identify, it ALSO has one called "DENSEL" (or DENsity SELect). If you set the controller to AT mode, then the docs do very explicitly state that "DENSEL becomes active high" (so if it's pulled high then that means there is HD media in the drive), but in PS/2 mode, then "DENSEL becomes active low" (if it's pulled high then DD media is in the drive)! And some IBM docs strongly imply (but -- again -- do not make 100% clear!) that in a media sense context, the signal line that NatSemi would call "DENSEL" is controlled by the drive, while in a non-media-sense ("host select") context, the same signal line is used BUT the *controller* pulls it high or low to signal to the drive what data rate to try to use to read the media.
So setting at least the National Semiconductor PC97338 to either AT or PS/2 mode does NOT simply enable or disable certain read-only registers or affect the layout of the contents within them. It ALSO changes how certain signal lines work.
But though that much is "clear", there are still ambiguities: the full text in the PC97338 datasheet actually says that for PC-AT mode, "DENSEL becomes active high signals (defaults to a 5.25 floppy disk drive)", and for PS/2 mode, "DENSEL becomes active low signals (defaults to a 3.5 floppy drive)". What the heck do those parentheticals mean?? Am I supposed to take away from this that DENSEL works differently in general for virtually all 3.5" drives vs. all 5.25" drives? Or is it just different for 3.5" drives intended for use with PS/2 machines than it is for those intended for use with the majority of "clone" machines? (No 5.25" HD drives have "media sense" capabilities, so having a drive pull DENSEL high or low doesn't really make any sense!)
The Winbond docs mention none of this, though, and only talk about the register differences between the two modes, so maybe Winbond doesn't change behavior by default? (Winbond also doesn't call any of the pins on their chip "DENSEL"...apparently different controller chips label the various signal lines differently.) But if it is a widespread convention by most FDC controller manufacturers to have both an AT and PS/2 "mode", then it might be an unspoken convention for signal lines to similarly change function when each mode is engaged, with only some manufacturers actually documenting this.
To further confuse matters, though, a 2.88 drive with media sense capabilities will have a *second* density selection signal line that it can pull high or low. Also, an IBM document somebody unearthed seems to imply that there are 3 types of multi-rate drives that IBM used with PS/2 systems: non-media-select 1.44 HD drives, non-media-select 2.88 ED drives, and so-called "Enhanced" 2.88 ED drives with media select, very much like what all HD and (apparently) ED drives intended for use with clones all employ. So some PS/2 floppy drives *do* have the microswitches, but only some 2.88 ones? Does the signaling for those work more like an AT-class/clone system, or...?
In any case, I can confirm that my "manufactured for IBM by Alps" drives (for use in ThinkPads) DO HAVE two microswitches: one beneath the position where the HD hole would be, and one beneath the position where the ED hole would be. So the drive at least SEEMS like it is either a media sense model, or is at least CAPABLE of media sense, but perhaps is not using it / isn't enabled? (I can't find any jumpers anywhere on the drive to change this behavior, while apparently SOME models of desktop drives are themselves dual-mode and can have their behavior be manipulated via jumpers or DIP switches.)
In conclusion: AAAAAAAARGH.