grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Workaround for the keyboard hang problem in intel mac


From: Bean
Subject: Re: [PATCH] Workaround for the keyboard hang problem in intel mac
Date: Wed, 7 May 2008 21:55:18 +0800

On Wed, May 7, 2008 at 8:55 PM, Robert Millan <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]