Floppy Disk Controller: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
More polling mode info, slight reformat, some fixes
Added a few more notes and comments
Line 11: Line 11:
(using CHS) in Real Mode. The rest of this article deals with creating Protected Mode drivers for the floppy subsystem.
(using CHS) in Real Mode. The rest of this article deals with creating Protected Mode drivers for the floppy subsystem.


Note: the Extended BIOS Int13h functions do not work with floppies.
Note: the BIOS IRQ0 handler remembers a timeout for turning the motor off, from the last BIOS floppy access. The last access may have been

Note2: the BIOS IRQ0 handler remembers a timeout for turning the motor off, from the last BIOS floppy access. The last access may have been
attempting to load your bootloader. So, in the distant future, if the BIOS ever receives 36 more IRQ0 ticks (if you ever return to Real Mode)
attempting to load your bootloader. So, in the distant future, if the BIOS ever receives 36 more IRQ0 ticks (if you ever return to Real Mode)
it may turn off your floppy motors for you, once.
it may turn off your floppy motors for you, once.
Line 119: Line 121:
Note that code snippets and datasheets name these registers based on their trigrams (e.g. SRA, MSR, DIR, CCR, etc.).
Note that code snippets and datasheets name these registers based on their trigrams (e.g. SRA, MSR, DIR, CCR, etc.).
Use standard "outb" and "inb" commands to access the registers.
Use standard "outb" and "inb" commands to access the registers.

== Reliability ==
In real hardware, floppy drives are extremely unreliable. On emulators, it doesn't matter -- but for code that is intended for
real hardware, make sure to retry every command at least twice more after any error.


The basic set of floppy registers can be found in the following enumeration:
The basic set of floppy registers can be found in the following enumeration:
Line 418: Line 424:


Note2: Emulators will often set the Disk Change flag to "true" after a reset, '''but this does not happen on real hardware''' -- it is
Note2: Emulators will often set the Disk Change flag to "true" after a reset, '''but this does not happen on real hardware''' -- it is
a shared bug in all the emulators that do it.
a shared bug in all the emulators that do it. Another shared bug is that most emulators do not fire an IRQ6 if disk polling mode is off.


Note3: A reset does not change the [[#Configure|drive polling mode or implied seek]] settings.
Note3: A reset does not change the [[#Configure|drive polling mode or implied seek]] settings.