Possible bug in the floppy driver

From: RaúlNúñez de Arenas Coronado (dervishd@linuxfreak.com)
Date: Sun Apr 23 2000 - 13:32:41 EST


    Hello everybody :)))

    Let's go to the matter ;)

    I'm trying to get the floppy geometry, and I issue the 'FDGETPRM'
ioctl to the proper device (it is correctly open, I'm sure), and for
the 'normal' floppy geometry (1440 kB) all seems to be ok. The
problem arise when I do *the same* on a non-standard floppy geometry
(currently it happens in 1760kB type).

    The fact is that these non-standard geometries are supported
directly by the kernel, and the geometry is reported correctly
*except* for the sector size. I use the 'FD_SECTSIZE' macro (defined
in <linux/fd.h>) and it returns 512 bytes per sector in the standard
geometries and 1024!!!! at 1760kB :?????????

    This is due the way the macro is defined. It uses the 'rate'
field in the 'struct floppy_struct', which is 0x0, 0x1 or 0x2 for all
normal formats and things like 0x8 for 1760 or even 0x20 for
others...

    The fact is that with this rate field some things cannot be done:
no correct sector size is reported, no floppy format greater than
1760 can be formatted (at least in my drive...).

    I've seen the 'floppy_type' array in the kernel sources (in file
drivers/block/floppy.c) and the rate field is very strange in some of
the formats...

    Why is this field ('rate', I mean) used to compute the sector
size? Is there any reliable way to get the sector size for a floppy?
Can I assume that the floppies always have 512 bytes sectors?

    Well, thanks again for wasting your time reading my 'almost bug
reports'. Last time you were of an invaluable help :)))

    Raúl Núñez de Arenas Coronado
    <dervishd@linuxfreak.com>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:22 EST