From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NptDC-0006Xt-Js for qemu-devel@nongnu.org; Thu, 11 Mar 2010 19:58:46 -0500 Received: from [199.232.76.173] (port=47216 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NptDB-0006XL-DO for qemu-devel@nongnu.org; Thu, 11 Mar 2010 19:58:45 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NptD8-0000qX-8o for qemu-devel@nongnu.org; Thu, 11 Mar 2010 19:58:45 -0500 Received: from mail-ew0-f213.google.com ([209.85.219.213]:35102) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NptD6-0000pw-SF for qemu-devel@nongnu.org; Thu, 11 Mar 2010 19:58:42 -0500 Received: by ewy5 with SMTP id 5so258788ewy.10 for ; Thu, 11 Mar 2010 16:57:58 -0800 (PST) Date: Thu, 11 Mar 2010 19:57:54 -0500 From: Kevin O'Connor Subject: Re: [Qemu-devel] Regression: more 0.12 regression (SeaBIOS related?) Message-ID: <20100312005754.GA3327@morn.localdomain> References: <473191351003071804x62acae0bk3f967b6be1f22a54@mail.gmail.com> <20100310021220.GB29054@morn.localdomain> <473191351003091949j6f3fbf98jadc87405876db214@mail.gmail.com> <20100310045942.GC29054@morn.localdomain> <473191351003092124o382bddc8m80df4676c048ec0a@mail.gmail.com> <20100311030742.GA26752@morn.localdomain> <473191351003102342x1f25f281l77a3b325726a602c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <473191351003102342x1f25f281l77a3b325726a602c@mail.gmail.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Roy Tam Cc: seabios@seabios.org, qemu-devel On Thu, Mar 11, 2010 at 03:42:28PM +0800, Roy Tam wrote: > Sorry I can't find documentation on this usage. But instead I have > lots of old programs written with this usage. > Using undocumented features from BIOS/DOS is very usual in that time. Can you confirm these other programs fail in the same way (no keyboard input, and "ps2 irq but no data." messages in log when using bios.bin-0.5.1-debug-20100228)? > > It's broken because it causes key presses to be lost and corrupted. > > The ps2 port hardware just doesn't work the way that software is > > trying to use it. > > > > You said that "it causes key presses to be lost and corrupted" but I > haven't heard any complain about this. > Real BIOSes (Award BIOS, AMI BIOS, Phoenix BIOS) handle this usage > very well and no key press are lost or corrupted. Under qemu-0.11 normal typing lead to lots of keyboard errors for me. It's possible real hardware would be less susceptible to this error, but there is nothing that a BIOS inside qemu can do to stop the corruption. > Any key press should generate 4 IRQs, for example when I press [Tab] > key, it should have IRQs like this: > ps2: data f (status=1d) > ps2: data f (status=1c) > ps2: data 8f (status=1d) > ps2: data 8f (status=1c) There is one irq on key press and one irq on key release. Your debugging output is in a loop and you're reporting the same event twice. > The following patch help people to see irq status and data change: The current SeaBIOS flow is effectively: // Read ps2 port status u8 status = inb(PORT_PS2_STATUS); if (!(status & I8042_STR_OBF)) // No event in queue - nothing can be dequeued. return; // Event in queue - dequeue it u8 data = inb(PORT_PS2_DATA); // Process the event. process_ps2byte(status, data); Your debugging patch is not correct becuase it performs the event dequeue before the check to see if there is an event in the queue. -Kevin