[comp.os.minix] Specifying floppy types

brucee@runxtsa.runx.oz.au (Bruce Evans) (10/21/90)

In article <1990Oct14.025522.4259@math.lsa.umich.edu> hyc@math.lsa.umich.edu (Howard Chu) writes:
>Or how about a standard method of telling the device driver (ioctl) the current
>disk geometry?

Such a method (including the whole driver) has already been posted for the ST
by Matthias Pfaller. It's not standard though. I keep the files in my to-do
directory...

I don't like one thing about this approach. The meaning of /dev/fdxyz would
not be fixed, nor would it be related to the current disk. Too many programs
might have to set and restore the device state. They might have to catch
more signals to clean up properly.

>This is what's been holding up the formatting routine for the
>Minix device driver.

Not really. The PC driver essentially does ioctls as writes. The PC floppy
hardware interface for formatting is a bit simpler (and less flexible) and
the data written for format is much like the data for an ioctl, so this
approach was natural. For the ST, you could "write" an extra block with the
format parameters before the blocks with the track data.

There was a good reason for avoiding ioctls in the 1.5 PC formatting interface.
The ioctl interface is weak (there is no way to pass more values than fit in
a message) and I had already changed too many things. I think the ST patch3
now passes a pointer to a user buffer like other *nix's.

My favorite idea for specifying the parameters is to encode them in the
device name. The name space is much larger than the space of minor numbers
so it is easier to make the names meaningful and to specify geometries not
known to the driver. Ast does not like this on the grounds that the names
should have no particular semantics.
-- 
Bruce Evans  (evans@syd.dit.csiro.au)

adrie@philica.ica.philips.nl (Adrie Koolen) (10/22/90)

In article <2452@runxtsa.runx.oz.au> brucee@runxtsa.runx.oz.au (Bruce Evans) writes:
>There was a good reason for avoiding ioctls in the 1.5 PC formatting interface.
>The ioctl interface is weak (there is no way to pass more values than fit in
>a message) and I had already changed too many things. I think the ST patch3
>now passes a pointer to a user buffer like other *nix's.

The Minix-Sparc floppy format method uses an ioctl() to format a track.
A pointer to a structure, containing formatting and disk parameters, is
passed. This structure contains the cylinder and head number, the density
and a pointer to an array, which contains sector numbering info. The
latter array isn't that nice, because it is controller specific, but the
usage of an ioctl() allows me to use SUSPEND replies so that the FS isn't
stopped while formatting a track. I don't see why the ioctl() interface
is weak. At least, there's no problem in tranferring an arbitrary amount
of data to the kernel. The driver should be a character type, though.

Adrie Koolen (adrie@ica.philips.nl)
Philips Innovation Centre Aachen