Re: [hatari-devel] Patch: IDE support for sector sizes > 512 bytes

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


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;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/