SD Virtual Floppies

In addition to its controller for "real" floppy drives, MIRE provides emulation of floppy drives through .DMK files stored on an SD or SDHC card.

Regardless of the DOS used, the TRS-80 Model I can address as many as four floppy drives (However, if any of the drives is double-sided, only three drives may be used. See below) Each of these three or four drives can be an external floppy drive or a DMK file stored on the SD card; DOS cannot tell the difference (except as described under "Limitations" below.)

The SD card must be formatted with a FAT (FAT16 or FAT32) filesystem. ExFAT and NTFS are not supported. You can have as many files (DMK and otherwise) on the card as desired, and subdirectories are supported. "Long" Windows filenames are not supported and are ignored by MIRE; however each long filename has an underlying "simple" filename that MIRE will see instead. In order for MIRE to see a file's complete name, it must be in 8.3 format: up to eight character filename optionally followed by a period and up to three character extension.

When MIRE is powered up or rebooted using the Model I keyboard's reset button, it searches for files in the SD root directory called FLOPPY0.DAT through FLOPPY3.DAT. For each of these files that exists, MIRE opens it and reads a text filename which should be that of a DMK file. MIRE then attempts to mount the specified DMK file as an emulated floppy drive. If successful, accesses to that physical floppy number (0 through 3) are redirected to the emulated drive (DMK file) instead of a physical floppy drive.

This arrangement allows selecting which DMK files will be mounted by editing (or deleting) the FLOPPYn.DAT text files on a PC, or by using the included DSK disk shell program on the TRS-80.

Note that each FLOPPYn.DAT file controls physical floppy drive #n. Many DOSes also have the concept of logical drives which may or may not refer to the same-numbered physical drive. MIRE does not and should not know about logical drive numbers.

SD cards may be inserted or removed when MIRE is powered down, or when it is powered up provided that the TRS-80 is inactive: idling at a DOS, BASIC, or DSK prompt, for example. If powered up when a card is inserted, the green LED will flash momentarily and then stay lit when the FAT filesystem has been mounted. The yellow LED indicates SD card activity.

If you have external floppy drives attached to MIRE, you might notice that their motors spin up when virtual floppies are accessed. This is intentional and necessary. The reason is that neither DOS nor MIRE can predict what an application program will do. Consider a program that copies a file from one floppy to another. If the source floppy is emulated and the physical drive motors were blocked from being activated by MIRE before reading from it, when the program then tries to dump the data to a destination floppy drive DOS assumes that the motors are already spinning. DOS would therefore not provide time for the destination drive to come to speed and file corruption would result.

Similarly, you might notice that the spin-up delay occurs when DOS accesses an emulated drive. In addition to the reasons given above, this is necessary because DOS doesn't know it's an emulated drive so it inserts the delay regardless. Some DOSes (including LDOS) allow the delay to be reduced somewhat: SYSTEM (DRIVE=d,DELAY=OFF).


Note: these limitations only apply to emulated floppies (.DMK files) on SD cards. MIRE's controller for "real" floppy drives can be used to format floppy diskettes; it is a complete reproduction of the WD1771 and WD1971 floppy controller chips and double-density add-on cards.

A Word About Drive #3 and Double Sided Operation

An original Expansion Interface could connect up to four external single-sided floppy drives, numbered 0 through 3. Each drive had an individual "Select" signal on the ribbon cable. A shared "Motor On" signal started all drives' spindle motors, and one of the Drive Select signals was asserted simultaneously causing that drive's activity LED to illuminate and that drive to be selected for all read/write/stepping commands.

When double-sided drives became available, the Drive Select signal for drive #3 was changed to the new "Side Select" function which, when asserted, caused the second side (side 1) of the selected floppy drive to be accessed. Thus if you had any double-sided drives connected (strictly speaking, only if they had double-sided floppies in them) you could not have a drive #3 attached. For example, if you had a double-sided floppy in drive 0 and access was made to its side 1, drive #3 would see its Drive Select asserted and perform the same operations, causing bad read data and a corrupted filesystem on writes.

So with an original Expansion Interface, you had to choose a configuration: up to four single-sided drives, or as many as three single or double-sided drives (which is the equivalent of six single-sided, so the fourth drive was usually no great loss.)

MIRE improves the situation somewhat. Since the emulated floppies are not accessed using Drive Select signals, you can have up to three single/double sided external or emulated drives 0-2, and also a single-sided emulated drive 3. The image mounted on drive 3 must be single-sided since there is no mechanism for selecting the second side of that drive. DOSes assume they are talking to an original Expansion Interface, which either has a Drive Select 3 or a Side Select signal, but not both. Warning: MIRE and the DSK program will not inform you if you mistakenly mount a double-sided image as drive #3. You can expect the image to become corrupted.

Note that none of this information relates to double-density operation. MIRE places no restrictions on which drives, external or emulated, can be double density.

Back to the main page