Using a USB Floppy Drive
by Jim Mock <[email protected]>
Introduction
Before I get too involved in the details of how to make a USB floppy
drive work under FreeBSD, allow me to provide some background
information. I recently acquired a Sony VAIO Z505HE laptop, and the
floppy drive provided with it was a USB floppy drive. This worked fine
during the initial install process, but failed to work after FreeBSD
was installed. At first, I didn't really mind since I don't use a
floppy drive all that much -- I usually only use it for installs. A
few weeks ago, I bought a Sony Mavica digital camera that stores its
images on a floppy disk. Suddenly, I had a reason to make use of the
floppy drive, so I decided to look into making it work.
The way things actually work are quite simple. There is no specific
USB floppy device driver for FreeBSD -- it uses the umass driver
instead. The umass driver is a USB device driver for disks and mass
storage. When you read from the floppy, you are actually reading it
from a SCSI device, therefore umass requires the scbus and da SCSI
devices as shown below.
Kernel Configuration
The first thing you will need to do is make sure that you have the
following SCSI devices in your kernel configuration file:
device scbus
device da
If you are using a GENERIC kernel, these devices are already present.
If you are using a custom kernel and have removed all of the SCSI
devices from it since none are present in your system, you will need
to add them to the configuration.
In addition to the above devices, you will also need USB support
compiled into the kernel as well. Here's the options in my kernel
configuration:
device uhci
device ohci
device usb
device ugen
device umass
Once you have the above in your kernel configuration file, recompile
your kernel and reboot as normal. Keep in mind, plugging in your USB
floppy now would be a good idea so it is detected when your machine
comes back up.
Using Your USB Floppy Drive
When your machine has finished rebooting, you should be able to use
your USB floppy as any other SCSI device. Since my digital camera uses
MS-DOS formatted floppy disks, to mount the disk, I simply do the
following:
# mount -t msdos /dev/da0 /mnt
After the disk activity is over, I can read the floppy on /mnt just
like any other filesystem. Additional options to the mount command are
available in the mount(8) man page.
Conclusion
After performing the above steps, you should be able to make use of
your USB floppy drive as if it were a 'normal' floppy drive. If you
have any questions or corrections, please feel free to contact me.
- jim |