Floppy Drive "Twaddle"
Posted: Fri Aug 16, 2024 3:19 pm
Hello everyone. I've asked this question around a few places so apologies if you've seen this before elsewhere.
This article on wiki.osdev.org describes a method referred to as "twaddling" to reset the disk change line on a floppy drive that's simpler than the usual way of seeking to track 1 then track 0. From the article:
Have tried this method on several PCs with varying generations of drives and controllers and this method has not worked on any (nor does it work on 86Box). The code is obviously quite simple, and I've tried adding various delays and no delay between the motor control register (3F2H) writes but no difference. Obviously, the article says "a small number of floppy drives" so entirely possible none of my drives are in that small number. However, I have tried some very common drive models such as the Teac FD-55G series, various common Sony/Teac/Mitsumi 1.44 drives and even a Sony 2.88 drive, so if those aren't compatible I'd imagine this was indeed a "small number".
Does anyone know anything more about this and any info about what kinds of drives might have actually supported it? Was it actually a specific controller/drive combination that made it work?
Or is it possible this test code is missing something? (I do hope it is that, otherwise this would be supported by literally no drives!)
This article on wiki.osdev.org describes a method referred to as "twaddling" to reset the disk change line on a floppy drive that's simpler than the usual way of seeking to track 1 then track 0. From the article:
Indeed, the Linux floppy driver source does implement this as the article says.Apparently, a small number of floppy drives also support one additional way to clear the bit -- something that Linux calls a "twaddle". Simply toggle the drive motor bit on, off, and then on again. When your driver tries to clear the Disk Change bit the first time, it can try a twaddle, and see if it works, and keep a flag if it does.
Have tried this method on several PCs with varying generations of drives and controllers and this method has not worked on any (nor does it work on 86Box). The code is obviously quite simple, and I've tried adding various delays and no delay between the motor control register (3F2H) writes but no difference. Obviously, the article says "a small number of floppy drives" so entirely possible none of my drives are in that small number. However, I have tried some very common drive models such as the Teac FD-55G series, various common Sony/Teac/Mitsumi 1.44 drives and even a Sony 2.88 drive, so if those aren't compatible I'd imagine this was indeed a "small number".
Does anyone know anything more about this and any info about what kinds of drives might have actually supported it? Was it actually a specific controller/drive combination that made it work?
Or is it possible this test code is missing something? (I do hope it is that, otherwise this would be supported by literally no drives!)
Code: Select all
MOV DX, 03F2H ; FDC DOR
MOV AL, 00011100B ; drive 0 motor ON, select drive 0, DMA+FDC enable
OUT DX, AL ; motor ON
DELAY_LOOP ; insert some delay here (or not)
XOR AL, 00010000B ; drive 0 motor OFF
OUT DX, AL ; motor OFF
DELAY_LOOP ; insert some delay here (or not)
XOR AL, 00010000B ; drive 0 motor ON
OUT DX, AL ; motor ON
DELAY_LOOP ; insert some delay here (or not)
MOV DX, 03F7H ; FDC DIR
IN AL, DX ; read change line state
TEST AL, 10000000B ; expect ZF indicating no change (change latch has been reset)