From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EYTXW-0004qn-Ad for qemu-devel@nongnu.org; Sat, 05 Nov 2005 14:17:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EYTXU-0004qZ-Dk for qemu-devel@nongnu.org; Sat, 05 Nov 2005 14:17:21 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYTXU-0004qW-AR for qemu-devel@nongnu.org; Sat, 05 Nov 2005 14:17:20 -0500 Received: from [212.227.126.177] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EYTXU-0006x3-3n for qemu-devel@nongnu.org; Sat, 05 Nov 2005 14:17:20 -0500 From: Volker Ruppert Date: Sat, 5 Nov 2005 20:18:43 +0100 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_TWQbDIu4OJWd2xQ" Message-Id: <200511052018.43972.info@vruppert.de> Subject: [Qemu-devel] [PATCH] cdrom fixes Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu Devel --Boundary-00=_TWQbDIu4OJWd2xQ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I tried to run the dos utility CDT in Qemu, but it always reported "no CD in drive" when a CD was present. I have created a patch to make the TOC command work in CDT. I still don't know how to fix the UPC/EAN stuff. The patch fixes the "mode sense" command and adds a partial implementation of "read subchannel". -- Bye Volker --Boundary-00=_TWQbDIu4OJWd2xQ Content-Type: text/x-diff; charset="us-ascii"; name="patch.qemu" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.qemu" diff -urN /home/volker/qemu/hw/ide.c ./hw/ide.c --- /home/volker/qemu/hw/ide.c 2005-08-06 11:32:01.000000000 +0200 +++ ./hw/ide.c 2005-11-05 20:10:56.752773808 +0100 @@ -1191,7 +1191,11 @@ break; case 0x2a: cpu_to_ube16(&buf[0], 28 + 6); - buf[2] = 0x70; + if (bdrv_is_inserted(s->bs)) { + buf[2] = 0x12; + } else { + buf[2] = 0x70; + } buf[3] = 0; buf[4] = 0; buf[5] = 0; @@ -1433,6 +1437,24 @@ padstr8(buf + 32, 4, QEMU_VERSION); ide_atapi_cmd_reply(s, 36, max_len); break; + case GPCMD_READ_SUBCHANNEL: + if (!bdrv_is_inserted(s->bs)) { + ide_atapi_cmd_error(s, SENSE_NOT_READY, + ASC_MEDIUM_NOT_PRESENT); + break; + } + if (packet[2] & 0x40) { /* SubQ not supported */ + ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, + ASC_INV_FIELD_IN_CMD_PACKET); + break; + } + max_len = ube16_to_cpu(packet + 7); + buf[0] = 0x00; + buf[1] = 0x00; /* audio not supported */ + buf[2] = 0x00; + buf[3] = 0x00; + ide_atapi_cmd_reply(s, 4, max_len); + break; default: ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC_ILLEGAL_OPCODE); --Boundary-00=_TWQbDIu4OJWd2xQ--