Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Km5f5-0005at-S5 for qemu-devel@nongnu.org; Sat, 04 Oct 2008 07:51:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Km5f5-0005ab-9R for qemu-devel@nongnu.org; Sat, 04 Oct 2008 07:51:03 -0400 Received: from [199.232.76.173] (port=54680 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Km5f5-0005aY-5u for qemu-devel@nongnu.org; Sat, 04 Oct 2008 07:51:03 -0400 Received: from batfish.pepperfish.net ([87.237.62.180]:33251 helo=flounder.pepperfish.net) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Km5f4-00008H-Kc for qemu-devel@nongnu.org; Sat, 04 Oct 2008 07:51:02 -0400 Received: from jennifer-internal.kyllikki.org ([10.112.102.2] helo=jennifer.kylikki.org) by flounder.pepperfish.net with esmtps (Exim 4.68 #1 (Debian)) id 1Km5f3-0005ts-0P for ; Sat, 04 Oct 2008 12:51:01 +0100 Received: from derik.kyllikki.org ([192.168.7.20]) by jennifer.kylikki.org with esmtp (Exim 4.63) (envelope-from ) id 1Km5f2-0001lU-KP for qemu-devel@nongnu.org; Sat, 04 Oct 2008 12:51:00 +0100 Received: from vince by derik.kyllikki.org with local (Exim 4.69) (envelope-from ) id 1Km5f2-0002gI-IJ for qemu-devel@nongnu.org; Sat, 04 Oct 2008 12:51:00 +0100 Date: Sat, 4 Oct 2008 12:51:00 +0100 From: Vincent Sanders Subject: Re: [Qemu-devel] Small issue in the IDE emulation Message-ID: <20081004115100.GB14712@kyllikki.org> References: <20081004111002.GA14712@kyllikki.org> <20081004113037.GA4540@implementation.famille.thibault.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CdrF4e02JqNVZeln" Content-Disposition: inline In-Reply-To: <20081004113037.GA4540@implementation.famille.thibault.fr> 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@nongnu.org --CdrF4e02JqNVZeln Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 04, 2008 at 01:30:37PM +0200, Samuel Thibault wrote: > Vincent Sanders, le Sat 04 Oct 2008 12:10:02 +0100, a =E9crit : > > While doing some other work I have come across a small issue with the > > DIAGNOSE command in the qemu IDE implementation. The status register > > value is dependant on the drive being a packet device or not. The > > simple patch (attached) fixes this. > >=20 > > =3D=3D=3D modified file 'hw/ide.c' > > --- hw/ide.c 2008-10-01 01:43:16 +0000 > > +++ hw/ide.c 2008-10-04 10:56:58 +0000 > > @@ -2308,8 +2308,15 @@ > > break; > > case WIN_DIAGNOSE: > > ide_set_signature(s); > > - s->status =3D READY_STAT | SEEK_STAT; > > - s->error =3D 0x01; > > + if (s->is_cdrom) > > + s->status =3D 0; /* ATAPI spec (v6) section 9.10 defin= es packet > > + * devices to return a clear status reg= ister > > + * with READY_STAT *not* set. */ >=20 > But shouldn't we at least set SEEK_STAT? Spec says: "If the device implements the PACKET command feature set, the device SHALL clear bits 6,5,4,3,2 and 0 in the Status register to zero." I beleive a version of this spec is available online http://www.t10.org/t13/project/d1410r3a-ATA-ATAPI-6.pdf page 362 (pdf page is 376 there is an offset) is where this is mentioned. And I just went and checked a couple of physical devices doing it and they do indeed behave as per the spec.=20 A few boot loaders that support older drive diagnostics through this method seem to get a bit confused if the status is not clear. >=20 > Samuel >=20 >=20 --=20 Regards Vincent http://www.kyllikki.org/ --CdrF4e02JqNVZeln Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFI51ikiUwwPOvjHvURAlE8AKCBCuHBA+v0QZ7C12QQ2thJvZquHACeNLxn pJIG6PGdWFczVYdahObBmnU= =amKE -----END PGP SIGNATURE----- --CdrF4e02JqNVZeln--