Technote

Details on USB for DOS (from a BIOS developer)

Russell writes:

I am a tremendous fan of FreeDOS, so as a USB/1394 BIOS engineer, I would like to provide you with the following information if it helps. (I want to make sure that you continue to be successful in your software endeavor.) You should be able to verify this information with PhoenixBIOS, and to a lesser extent with Award. This info is current as of 2001, so if anything, the situation has improved a bit. Of course, I'm speaking about only the latest PC systems. I am not here to defend any particular corporate interest. I do, however, have a tremendous interest in the proliferation and success of FreeDOS.

1. Keyboard and mouse should work fine. This is done by emulating the PS/2 hardware using system management interrupts (SMIs). INT 16h is absolutely like normal.

2. USB floppy emulation works by creating the appearance of a classic floppy drive on INT 13h. Again, this should not be distinguishable from an ordinary floppy. Likewise for USB-based floppy emulation images on CD.

3. Harddrives are the hard part. ZIP drives should work fine, but the problem with most (not quite all) harddrives is that they are not compliant with the USB Mass Storage Class specification. When the BIOS enumerates the USB bus during POST, it looks for USB harddrives which adhere to that specification. Other drives that identify themselves as proprietary are ignored. So my recommendation to FreeDOS users would be to use only those mass storage devices which comply, such as must stuff from Iomega (and a few other companies such as Hagiwara Sys-Com from Japan). PhoenixBIOS works with the 2.2GB Castlewood Orb removable drive as well. Basically, if the BIOS can't see it or boot from it, then in effect (and probably fact) it's noncompliant.

4. If users start attempting to install drivers for USB mass storage devices which are not supported by the BIOS, I can guarantee that disaster will result. I strongly want to warn you about this, because I fear that people will unfairly point fingers at FreeDOS when drivers fail. It's a complex thing to explain, but USB is a nightmare from the hardware up through the software. In a nutshell, there is no BIOS abstraction layer through which to speak with a single device, so a FreeDOS driver must hijack the chipset itself, which will often disconnect other devices in the process. Hence my recommendation in #3.

5. Let your users know that they should not even dream of inserting or disconnecting anything on the USB bus while the PC is on (expect in a fully USB-aware OS, and not necessarily even then). Reenumeration is a horrific software task riddled with corner cases, thanks to bad USB architecture and poorly tested devices. (It's little wonder that the president of Via Technologies tried unsuccessfully in 2000 to create an industry task force to prevent USB 2.0 from happening, in favor of 1394.)

One other thing... in the wish list area, I notice that when I load Nikita 8 without an extended memory manager, it can't read my 40GB FAT32 drive. It runs out of memory. It would be nice if that didn't happen (but I realize that it might require a lot of rewriting to fix, so it's only a wish list item). If this has already been reported, then I apologize for the reiteration.