USB FDD access

Page 2/2
1 |

By Pencioner

Hero (634)

Pencioner's picture

07-03-2018, 14:29

rderooy wrote:

Manuel, when you tried it, I assume this was using a legacy FDD using /dev/fd0?

Just as an additional comment, for those interested in trying this... To find which Linux DEV devices are associated with the USB FDD, you can simply do the following:

$ sudo ufiformat -i
disk         generic     
/dev/sdb     /dev/sg2

By any means, did you try to use the /dev/sg2 instead of /dev/sdb ? just curious (can't test it myself because have no floppy usb at home)

By rderooy

Champion (324)

rderooy's picture

07-03-2018, 21:14

Pencioner wrote:

By any means, did you try to use the /dev/sg2 instead of /dev/sdb ? just curious (can't test it myself because have no floppy usb at home)

That does not work. At least when I use /dev/sdb I get some disk activity on startup, but when I use /dev/sg2 I get none.

By rderooy

Champion (324)

rderooy's picture

07-03-2018, 21:15

wouter_ wrote:

OpenMSX expects the following from a disk image (either a real file or a device file like /dev/fd0).

1) It must allow random access in chunks of 512 bytes.
2) The layout (=order of the sectors) must be compatible with the layout of .dsk files.
3) It must be possible to query the filesize (to figure out how many sectors are present).

This used to work for /dev/fd0 in the past, but I haven't been able to test this myself for many years. I never tried it with a USB FDD.

One thing that _might_ have changed is point 3). In the past this was implemented as:
- seek to the end of the file, get the current file offset, seek back to the start
Now filesize is queried in a single step via fstat(). But I have no idea if this makes any difference. (Obviously it works fine for regular files).

Could you check if the USB FDD /dev/sdb file meets requirements 1-3?

Thanks wouter_. Any suggestions on how I can test this without writing a C program?

Page 2/2
1 |
My MSX profile