Re: [hatari-devel] Patch: IDE support for sector sizes > 512 bytes |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Patch: IDE support for sector sizes > 512 bytes
- From: Thomas Huth <th.huth@xxxxxxxxx>
- Date: Sun, 11 Nov 2018 08:10:19 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1541920220; bh=6HmSZQumKdVM925rzBk+7RUoVCIqnoinjqx0+F0kIp8=; h=Date:From:To:Subject:From; b=R1hXBfes6y1ayi0whbucTGhq685XZ7DWWn75ieOSH9RI0XjoVfvu4dwdmry4seh/q mHUJtoUpI9mcV7YSzf5+PJws4PN8znQw4wQrV6I1I5GYZPByFGNlJPxz6kJEToKW4a U1LDc9UJ7Dm5P0G/cRm2oYo0R/z2nPZ7don+ZmSFMZqE1crUC2qC8fITuN4XvlFJmD dqKFOylWWKc01+RUVPxo7nDnQSFzC+WKjo7NITnDuhYXetWZDn6mi5SeAEmF5mRmCr zq7F/8UOOQNshvS3nPb9Y6tJQIliVwo63cHDuWNOWPIrC+XWmOkeRCVYDMuRPfFzhK c8zFgsDBMBnWg==
Am Fri, 9 Nov 2018 08:34:45 +0100
schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:
[...]
> > @@ -1802,7 +1802,6 @@
> > uint64_t total_sectors;
> >
> > bdrv_get_geometry(s->bs, &total_sectors);
> > - total_sectors >>= 2;
> > if (total_sectors == 0)
> > {
> > ide_atapi_cmd_error(s, SENSE_NOT_READY,
> >
> > Why this change? Even current QEMU still contains the shift, so I
> > somehow doubt that this is really right?
>
> The sector size for emulated (data) CDs is 2048 bytes, and QEMU also
> uses this size a few lines below:
>
> cpu_to_ube32(buf + 4, 2048);
>
> But if you shift to the right the calculated capacity is just 1/4 of
> what it actually is. You can also see in HDDRUTIL that the result of
> READ CAPACITY is just 1/4 of the actual file size when the shift is
> applied. This looks like a bug in the QEMU code to me. You may want
> to double-check.
Ok, I see your point - but if it's wrong in that case, it's also wrong
for the other cases (e.g. GPCMD_SEEK and GPCMD_READ_CDVD_CAPACITY)...
And since current QEMU (file hw/ide/atapi.c) also still contains these
shifts, I'd like to get this discussed with the folks from QEMU first
before we blindly fix this in the wrong way in Hatari only... I'll try
to remember to ask this on the qemu-devel mailing list next week.
Thomas