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: Fri, 9 Nov 2018 00:07:22 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1541718443; bh=3c5oi854PxMe1I1VRkXLo1d1Hp82YU4EScEAfD1C3jc=; h=Date:From:To:Subject:From; b=iRI885qGQk+NrQe/wkLbW5pTNUvIf3yauEmRjdPmk4Lm4lpSxSekNQlcyFluJAZdX Jtjot+XTUSdevqcGj+3/ngc5GJuEJMUI9Yvp/OKzghZhckaw01fFln9lg9VHU+D6Rp 8U0sKZUE6DgNaRkIGLgf91LYWFY6ljWRVwG6MFZLyrKgKt6/1c6YGic9fD7sg4r/IS wcKW42+qNHAywXcKMpD0Vb6BOng8g2GiuSO4ljDmRKLlviQMO0xcIIFxmX12GQSCtm wzR2h4QIcQGragAvZxX0Hl2B9/ZG5ujmRdaM22q7Xm+bkqgVkhbS+Ca6nxUGttahPP 0ViHQgROxkMnQ==
Am Tue, 6 Nov 2018 20:54:35 +0100
schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:
> Hi Thomas,
>
> Thank you. The attached patch contains some minor adjustments for
> optical (i.e. non hard disk) ATAPI devices.
Hi Uwe,
some comments on this patch:
@@ -983,11 +983,11 @@
padstr((char *)(p + 23), FW_VERSION, 8); /* firmware version */
if(s == opaque_ide_if) /* model */
{
- padstr((char *)(p + 27), "Hatari IDE0 disk", 40);
+ padstr((char *)(p + 27), "Hatari IDE0 disk", 40);
}
else
{
- padstr((char *)(p + 27), "Hatari IDE1 disk", 40);
+ padstr((char *)(p + 27), "Hatari IDE1 disk", 40);
}
Why the white space change? Also, I think we agreed in another mail
that the name should rather not depend on the slot, so maybe we should
rather change this to "Hatari IDE disk" unconditionally?
Anyway, this should be a separate patch instead.
@@ -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?
@@ -1867,8 +1866,13 @@
ide_atapi_cmd_ok(s);
break;
case GPCMD_INQUIRY:
+ {
+ uint64_t total_sectors;
+
+ bdrv_get_geometry(s->bs, &total_sectors);
+
max_len = packet[4];
- buf[0] = 0x05; /* CD-ROM */
+ buf[0] = 0x05; /* MMC drive */
buf[1] = 0x80; /* removable */
buf[2] = 0x00; /* ISO */
buf[3] = 0x21; /* ATAPI-2 (XXX: put ATAPI-4 ?) */
@@ -1876,11 +1880,12 @@
buf[5] = 0; /* reserved */
buf[6] = 0; /* reserved */
buf[7] = 0; /* reserved */
- padstr8(buf + 8, 8, "QEMU");
- padstr8(buf + 16, 16, "QEMU CD-ROM");
+ padstr8(buf + 8, 8, "Hatari");
+ padstr8(buf + 16, 16, "CD/DVD-ROM");
padstr8(buf + 32, 4, FW_VERSION);
ide_atapi_cmd_reply(s, 36, max_len);
break;
+ }
Fine for me if we change the strings here, but why do you introduce
total_sectors here without using it?
Thomas