Mellvik / TLVC

Tiny Linux for Vintage Computers
Other
7 stars 0 forks source link

Raw floppy IO fails if block size exceeds track size #40

Closed Mellvik closed 5 months ago

Mellvik commented 5 months ago

The raw floppy driver doesn't check that the requests are physically possible. With 20b (10k) being the (currently) largest possible block, all IO requests on a 360k floppy will fail (2 tracks = 1 cylinder = 2x9 sectors = 18 blocks), the driver reporting an unknown error. Using the track size as block size in such cases will work and is the preferable workaround.

This problem will occur with any block size if the request spans a cylinder boundary. e.g. dd if=/dev/rdf0 skip=17b bs=2b will fail on a 360k floppy.

Mellvik commented 5 months ago

Fixed by PR #46 .