From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1ML85E-0004R5-2S for mharc-grub-devel@gnu.org; Mon, 29 Jun 2009 00:03:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ML85D-0004PX-35 for grub-devel@gnu.org; Mon, 29 Jun 2009 00:03:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ML857-0004LS-Sq for grub-devel@gnu.org; Mon, 29 Jun 2009 00:03:06 -0400 Received: from [199.232.76.173] (port=32825 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ML854-0004HW-Vb for grub-devel@gnu.org; Mon, 29 Jun 2009 00:02:59 -0400 Received: from c60.cesmail.net ([216.154.195.49]:45594) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1ML854-0007Jn-5h for grub-devel@gnu.org; Mon, 29 Jun 2009 00:02:58 -0400 Received: from unknown (HELO smtprelay2.cesmail.net) ([192.168.1.112]) by c60.cesmail.net with ESMTP; 29 Jun 2009 00:02:57 -0400 Received: from [192.168.0.22] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by smtprelay2.cesmail.net (Postfix) with ESMTPSA id F0A4334C6D for ; Mon, 29 Jun 2009 00:10:01 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <20090627112521.GA28637@thorin> References: <20090627112521.GA28637@thorin> Content-Type: text/plain Date: Mon, 29 Jun 2009 00:02:55 -0400 Message-Id: <1246248175.22661.19.camel@mj> Mime-Version: 1.0 X-Mailer: Evolution 2.26.2 (2.26.2-1.fc11) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: at_keyboard flush on i386-qemu X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2009 04:03:07 -0000 On Sat, 2009-06-27 at 13:25 +0200, Robert Millan wrote: > Hi, > > Pavel pointed out earlier that sometimes when starting on i386-qemu GRUB > receives spurious events from AT keyboard. Yes, it's still happening, but not always. Approximately half of the time I'm getting "2" at the prompt. > It seems that it is the role > of the firmware to flush this buffer at startup. > > Unless someone has a better idea, I would fix this with: > > - Moving at_keyboard to kernel on i386-qemu. > > - [ifdef GRUB_MACHINE_QEMU]: flush the input buffer at at_keyboard > startup by reading and discarding events for a fixed amount of time. I would just read and discard the keyboard data from the port at startup without embedding at_keyboard. > I don't like that we have a race here. Suggestions welcome on how to > improve that, but TTBOMK if there's more than one event you can't tell > when you're processing the last one. I think there is at most one event. And I suspect it's due to a qemu bug. Or at least qemu could do better by starting in the same state every time. -- Regards, Pavel Roskin