DOS Days

USB Support in DOS

There is no native support for the Universal Serial Bus (USB) in DOS.

However, a number of drivers have been written by third parties to allow access to mass storage devices (USB sticks, CD/DVD-ROM drives, flash drives, flash cards attached to flash readers, USB hard disks, etc) directly in DOS.

These are known as ASPI drivers, and they provide access to either standard USB 1.1 (OHCI/UHCI) or high speed USB 2.0 (EHCI).

OHCI stands for Open Host Controller Interface - a standard that was developed by Compaq to allow a computer to interface with FireWire and USB 1.0 and 1.1 devices.The Universal Host Controller Interface, or UHCI, is similar but developed by Intel.

These were later superceded by EHCI which stands for Enhanced Host Controller Interface. There is no driver or interface protocol for USB 3.0, but USB 3.0 is backward-compatible with USB 2.0 and 1.x, so the drivers should still work with USB 3.0 devices.

The specific driver I have had success with is the Panasonic Communications Co. ASPI Manager for USB mass-storage (Universal Driver) Version 2.20 - phew! It supports all major motherboard chipsets including Intel, ALi, SiS, VIA, and nVidia. It does not support hot-plugging your device once the driver has loaded.

The two files you need are usbaspi.sys and di1000dd.sys. To get this working, simply copy these two files to C:\DOS for example, and add the following two lines to your config.sys file:

device=C:\DOS\usbaspi.sys /w /v
device=C:\DOS\di1000dd.sys

The /w argument forces the driver to wait - it will prompt you to insert the mass storage device whenever you boot your computer. The /v argument forces verbose output so you can see what it's doing.

Upon restart, you should see something like this:

When you press enter, the driver will attempt to detect any USB drives in your USB ports. If any are found you will see something like this, where a drive letter is assigned to the USB drive:

Of course, being DOS, there are still file system constraints and disk size constraints that cannot be overcome, and the majority of USB sticks, SD cards, and USB hard disks all far exceed these DOS limits. In the case of USB sticks and USB hard disks, make sure the partition is 500 MB or smaller in size or the driver will fail. It also needs to be formatted as a FAT-16 partition, since FAT-32 is not supported in DOS.

Once the driver has successfully loaded, your USB stick/hard disk/CD-ROM drive, etc, will be assigned a drive letter just like your floppy drives and hard disks. Also make sure you've added LASTDRIVE=G (for example) to your config.sys file, otherwise the driver may throw an error telling you there are no more drive letters available!

In use, I also noticed that usually a hard reset was necessary for the driver to correctly detect a new USB stick. If I just used CTRL-ALT-DEL after inserting the USB stick it wouldn't detect it.

Further Command-Line Arguments

The USBASPI.SYS file accepts the following arguments:

/e Instructs the driver to use the EHCI (USB 2.0) specification
/o Instructs the driver to use the OHCI (newer USB 1.0) specification
/u Instructs the driver to use the UHCI (older USB 1.0) specification
/l=n Allows you to define the highest LUN # to be attached to the device ID (the default is 0)
/w Wait - upon driver startup it prompts you to insert the USB device
/v Verbose output
/f  
/r  
/slow  
/nocbc  
/norst  
/noprt  

By default the driver scans using all three controller specifiations (OHCI, EHCI and UHCI). This is restricted to just one if you use the /e, /o or /u arguments.

Using the Driver in VirtualBox

Rufus Cannon got in touch as he had identified an issue when running DOS virtually in VirtualBox 7.0. He said that when the driver loaded, he received the error "USBASPI : Target USB device not found.". He was running FreeDOS v1.3.

This was noticed when he chose the "USB v2.0 (OHCI + EHCI) Controller" option in VirtualBox's USB settings. By then choosing "USB v1.1 (OHCI) Controller" instead, and making sure to unmount the USB drive before starting VirtualBox (he runs it on Linux), USBASPI.SYS then detected the USB drive correctly, a DI1000DD.SYS assigned it a drive letter.

Incidentally, I tested the driver on real hardware with FreeDOS v1.3 and it works just fine.