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: Uwe Seimet <Uwe.Seimet@xxxxxxxxx>
- Date: Tue, 6 Nov 2018 20:54:35 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1541534075; s=strato-dkim-0002; d=seimet.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=4iNtbb4O4dRh2kjK3ZKKMgOebBupJ5hZo36aZ/g0eGQ=; b=D4tToneqxJ4EqnSE5y22JqrCOUQd4s5VD4xZwI2c6Aftzgk8ojjpFQZQJ0sM/B8um8 zm7bswZ4Qv/lpXJYprREEeFBgtfBIFW4cdYQdSl47DLjx6wB1MA8th9tFS6n5C1tskTN PdVNvrPM4TNJOxqZAN+pTMRBxgred3fSjofo7wOr7VJC9jVPQGfJL2awZLUVvRVaMC2A 9rD4vlwfa2u3yYmoEFD7QF3P7uCqbIj9Wa6FbE6/TA0bsJdSMzn3z7yqrLymRY8G603M P29e25C1PhFlUc8wd9/H9KcUJjsFx1IrzgP72inJPSg9t5V1ttXKEpjRZigbEc7bO97z MVxw==
Hi Thomas,
Thank you. The attached patch contains some minor adjustments for
optical (i.e. non hard disk) ATAPI devices.
Sooner or later I might add DVD-RAM support and support for other rewritable
optical media.
Take care
Uwe
> Am Sun, 21 Oct 2018 09:54:51 +0200
> schrieb Uwe Seimet <Uwe.Seimet@xxxxxxxxx>:
>
> > Hi,
> >
> > I extended the previous patch by enabling the existing CD-ROM support
> > with a new configuration property. The attached patch includes the
> > sector size changes from the previous patch + enablement of CD-ROM
> > support.
>
> Patch looks fine, so finally pushed to the repository.
>
> Thanks,
> Thomas
>
>
diff -r 50529141b394 src/ide.c
--- a/src/ide.c Tue Nov 06 16:06:09 2018 +0100
+++ b/src/ide.c Tue Nov 06 20:50:05 2018 +0100
@@ -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);
}
#if MAX_MULT_SECTORS > 1
put_le16(p + 47, 0x8000 | MAX_MULT_SECTORS);
@@ -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,
@@ -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;
+ }
case GPCMD_GET_CONFIGURATION:
{
uint64_t total_sectors;