[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Floppy issues



On 25 Oct 12:35, Gregor Riepl wrote:
> > We fixed that in T2 Linux (debugged that for a longer time .. ), the reason was
> > that the the probe __floppy_read_block_0 tries to read 1 page from disk, 8KB,
> > which was more than the derived floppy size of 8 sectors (4KB) from the minor
> > number, so the "beyond end of device" message comes up, see:
> > https://github.com/rxrbln/t2sde/blob/main/package/kernel/linux/hotfix-floppy-not-4k-pages.patch
> 
> Is this common for PC floppy drives?
> Perhaps /dev/fd0 should register itself with the correct minor number instead.

Yes, it's common, as far as I understand the floppy driver, it
auto-detects the disk geometry by reading the first block ("bootblock")
in floppy_revalidate and __floppy_read_block_0 [1].

The auto-detection is also noted in admin-guide/devices.txt [2]: 

   2 block      Floppy disks
                  0 = /dev/fd0          Controller 0, drive 0, autodetect

> Perhaps /dev/fd0 should register itself with the correct minor number instead.

That might be difficult, as you could put in disks with a different
kind of geometry.

Regards,
Florian

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/block/floppy.c#n4134
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/admin-guide/devices.txt#n49


Reply to: