Floppy support

David Zeuthen david at fubar.dk
Thu Jun 24 15:12:08 PDT 2004


I just added support for floppy drives to HAL - it works with both
legacy drives (e.g. x86) and the USB floppy drive I just got today[1]. A
few notes as the patch was pretty big and some fundamental changes was
introduced since floppies, uhmm, suck.

As legacy floppy drives don't support polling (the drive is constantly
spinning if we poll), so storage.media_check_enabled is set to false by
default. It's pretty cool, you can change this while hald is running

 hal-set-property --udi /org/freedesktop/Hal/devices/legacy_floppy_0 --key storage.media_check_enabled --bool true

if you don't mind the noise and don't care about wearing out your
drive :-). It is not recommended though; use it at your own risk, etc.

The way HAL treats drives where

 a) block.no_partitions==TRUE
 b) storage.media_check_enabled==FALSE

is special; we only put a child to the top-level block device if it is
mounted. This is policy, yes, but if you think about it it's the only
sane thing to do as the user may have removed the media from the drive
and I'd rather expose less, but correct information than information
that is false. Unless anyone got a better idea?

Moving on, it turns out my new USB floppy drive can actually be polled
without the side effects mentioned above so with the utopia stack
everything just works like with USB or Firewire storage, just a bit
slower obviously. Which is cool and nice.

So by default, non-legacy floppy drives (which are treated no different
in HAL than e.g. USB storage except that storage.no_partitions is TRUE)
will be polled. If this is a problem with a device, just send me a .fdi
file to merge the storage.media_check_enabled to FALSE  to blacklist it
and I'll include it in the hal tree. I'm curious if it works on all USB
floppy drives, please share your experiences.

Here is a screenshot : http://freedesktop.org/~david/floppy-support.png

I've had to make a few hacks here and there (not too ugly :-) because of
some shortcomings in the sysfs interfaces; I'll post a long list in the
near future about the current issues with Linux 2.6.

Finally, I think this basically concludes handling storage devices in
HAL; as I see it we've covered more or less all the different types of
devices that is mainstream (floppy, usb, firewire, optical drives). Or
is there anything I've missed?


[1] : and it took me 10+ minutes to find a floppy :-)

hal mailing list
hal at freedesktop.org

More information about the Hal mailing list