[PATCH v2] fdc: fix floppy boot for Red Hat Linux 5.2

John Snow posted 1 patch 3 years ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20210427181010.1920534-1-jsnow@redhat.com
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>
hw/block/fdc.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v2] fdc: fix floppy boot for Red Hat Linux 5.2
Posted by John Snow 3 years ago
The image size indicates it's an 81 track floppy disk image, which we
don't have a listing for in the geometry table. When you force the drive
type to 1.44MB, it guesses the reasonably close 18/80. When the drive
type is allowed to auto-detect or set to 2.88, it guesses a very
incorrect geometry.

auto, 144 and 288 drive types get the right geometry with the new entry
in the table.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>

---

V2: I didn't actually stage this, so this is just a re-send to get a
fresh Message-ID to reference in the PR. Added Thomas's R-B.

 hw/block/fdc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index a825c2acbae..0f0c716d878 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -122,6 +122,7 @@ static const FDFormat fd_formats[] = {
     /* First entry is default format */
     /* 1.44 MB 3"1/2 floppy disks */
     { FLOPPY_DRIVE_TYPE_144, 18, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 2880 */
+    { FLOPPY_DRIVE_TYPE_144, 18, 81, 1, FDRIVE_RATE_500K, },
     { FLOPPY_DRIVE_TYPE_144, 20, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 3200 */
     { FLOPPY_DRIVE_TYPE_144, 21, 80, 1, FDRIVE_RATE_500K, },
     { FLOPPY_DRIVE_TYPE_144, 21, 82, 1, FDRIVE_RATE_500K, },
-- 
2.30.2


Re: [PATCH v2] fdc: fix floppy boot for Red Hat Linux 5.2
Posted by John Snow 2 years, 11 months ago
On 4/27/21 2:10 PM, John Snow wrote:
> The image size indicates it's an 81 track floppy disk image, which we
> don't have a listing for in the geometry table. When you force the drive
> type to 1.44MB, it guesses the reasonably close 18/80. When the drive
> type is allowed to auto-detect or set to 2.88, it guesses a very
> incorrect geometry.
> 
> auto, 144 and 288 drive types get the right geometry with the new entry
> in the table.
> 
> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
> Signed-off-by: John Snow <jsnow@redhat.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> ---
> 
> V2: I didn't actually stage this, so this is just a re-send to get a
> fresh Message-ID to reference in the PR. Added Thomas's R-B.
> 
>   hw/block/fdc.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index a825c2acbae..0f0c716d878 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -122,6 +122,7 @@ static const FDFormat fd_formats[] = {
>       /* First entry is default format */
>       /* 1.44 MB 3"1/2 floppy disks */
>       { FLOPPY_DRIVE_TYPE_144, 18, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 2880 */
> +    { FLOPPY_DRIVE_TYPE_144, 18, 81, 1, FDRIVE_RATE_500K, },
>       { FLOPPY_DRIVE_TYPE_144, 20, 80, 1, FDRIVE_RATE_500K, }, /* 3.5" 3200 */
>       { FLOPPY_DRIVE_TYPE_144, 21, 80, 1, FDRIVE_RATE_500K, },
>       { FLOPPY_DRIVE_TYPE_144, 21, 82, 1, FDRIVE_RATE_500K, },
> 

Staged on my floppy branch.

--js