Re: Possible bug in the floppy driver

From: Guest section DW (dwguest@win.tue.nl)
Date: Sun Apr 23 2000 - 20:17:09 EST


On Sun, Apr 23, 2000 at 08:32:41PM +0200, RaúlNúñez de Arenas Coronado wrote:

> 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 :?????????

Yes, lots of exclamation and question marks. But I do not yet see any problem.

> 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...

Clearly, the author did not want to waste bits and packed the three bits
describing the sector size in front of the three bits describing the rate.

[Yes, sectors can have sizes 128, 256, 512, 1024, 2048, 4096, 8192, 16384
and can even have variable length, although many of these values are not
supported on many media.]

-
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