Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jtk7C-0002Yd-Bo for mharc-grub-devel@gnu.org; Wed, 07 May 2008 09:55:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jtk7B-0002Xy-6f for grub-devel@gnu.org; Wed, 07 May 2008 09:55:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jtk79-0002Wo-P2 for grub-devel@gnu.org; Wed, 07 May 2008 09:55:24 -0400 Received: from [199.232.76.173] (port=60505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jtk79-0002We-Dw for grub-devel@gnu.org; Wed, 07 May 2008 09:55:23 -0400 Received: from ti-out-0910.google.com ([209.85.142.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jtk78-0004BK-RJ for grub-devel@gnu.org; Wed, 07 May 2008 09:55:23 -0400 Received: by ti-out-0910.google.com with SMTP id u5so73751tia.10 for ; Wed, 07 May 2008 06:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/f9iVKa7DE2eRDN68ri8ArkxF1omo1MvmVHJfXDKZOU=; b=j+HTPgUynBd4QfZ+zc8ZN34Dj/Nlm2jJC+3bL/QwGmtcOcsz+6PmAFgqiK9qA9ysxDzI+5djwPKxuZellVPWikU1QIH0DjO6OztoG+EKeD4i3Hgl7sfW4hB88alGTPvHAgLqu3DCZwKEq8v8gWNV8t44Rw7EtZ/w55WxahtoHqc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aYrBemyYc6ZLfONHtq9dgJ40qRBQsvw1pEHFe5dWrbgIFiUMGRdId1gcBFMyHV1u/R0P1Pyo0QovGY3FL8SSo1dr2CHuAHaoj0Z4T45/KwnmfNu1AokdcbWqgKntr/zL1Vz/uEjBMsXf7VfjNUwQTblhQjKmrOvcqYOB8rqQk78= Received: by 10.110.3.8 with SMTP id 8mr201709tic.11.1210168518945; Wed, 07 May 2008 06:55:18 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Wed, 7 May 2008 06:55:18 -0700 (PDT) Message-ID: Date: Wed, 7 May 2008 21:55:18 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080507125554.GC16492@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080507125554.GC16492@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] Workaround for the keyboard hang problem in intel mac 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: Wed, 07 May 2008 13:55:25 -0000 On Wed, May 7, 2008 at 8:55 PM, Robert Millan wrote: > I think it'd be nice to have a comment there explaining why this is done. Hi, You're right, here is the patch with comment: diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 5d4bbcb..a67bf6d 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1240,6 +1240,26 @@ FUNCTION(grub_console_getkey) call prot_to_real .code16 + /* + * Due to a bug in apple's bootcamp implementation, INT 16/AH = 0 would + * cause the machine to hang at the second keystroke. However, we can + * work around this problem by ensuring the presence of keystroke with + * INT 16/AH = 1 before calling INT 16/AH = 0. + */ + + pushfw + sti + +1: + movb $1, %ah + int $0x16 + jnz 2f + hlt + jmp 1b + +2: + popfw + movb $0, %ah int $0x16 movw %ax, %dx /* real_to_prot uses %eax */ -- Bean