]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-07-21 Bean <bean123ch@gmail.com>
authorbean <bean@localhost>
Mon, 21 Jul 2008 10:40:01 +0000 (10:40 +0000)
committerbean <bean@localhost>
Mon, 21 Jul 2008 10:40:01 +0000 (10:40 +0000)
* kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for
a20. Run keyboard test last, as it will cause macbook to halt.

ChangeLog
kern/i386/pc/startup.S

index 7df7c4219679ea7f2a3f610440623bbba5c7e424..2fe222616ab63dd8dd9aa60a5b6a4e87e46dfaaf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-07-21  Bean  <bean123ch@gmail.com>
+
+       * kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for
+       a20. Run keyboard test last, as it will cause macbook to halt.
+
 2008-07-18  Pavel Roskin  <proski@gnu.org>
 
        * kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P.  We cannot
index 8f420ccdc2c1bb351bb9d40d6bc96ec69380ff6a..75c46adee2aae05b7ae2679be8afeaf04821cfbd 100644 (file)
@@ -386,9 +386,32 @@ gate_a20_try_bios:
        popl    %ebp
        call    gate_a20_check_state
        cmpb    %al, %dl
-       jnz     gate_a20_try_keyboard_controller
+       jnz     gate_a20_try_system_control_port_a
        ret
        
+gate_a20_try_system_control_port_a:
+       /*
+        * In macbook, the keyboard test would hang the machine, so we move
+        * this forward.
+        */
+       /* fourth, try the system control port A */
+       inb     $0x92
+       andb    $(~0x03), %al
+       testb   %dl, %dl
+       jz      6f
+       orb     $0x02, %al
+6:     outb    $0x92
+
+       /* When turning off Gate A20, do not check the state strictly,
+          because a failure is not fatal usually, and Gate A20 is always
+          on some modern machines.  */
+       testb   %dl, %dl
+       jz      7f
+       call    gate_a20_check_state
+       cmpb    %al, %dl
+       jnz     gate_a20_try_keyboard_controller
+7:     ret
+
 gate_a20_flush_keyboard_buffer:
        inb     $0x64
        andb    $0x02, %al
@@ -425,30 +448,11 @@ gate_a20_try_keyboard_controller:
        outb    $0x64
        call    gate_a20_flush_keyboard_buffer
 
-       call    gate_a20_check_state
-       cmpb    %al, %dl
-       jnz     gate_a20_try_system_control_port_a
-       ret
-
-gate_a20_try_system_control_port_a:
-       /* fourth, try the system control port A */
-       inb     $0x92
-       andb    $(~0x03), %al
-       testb   %dl, %dl
-       jz      6f
-       orb     $0x02, %al
-6:     outb    $0x92
-
-       /* When turning off Gate A20, do not check the state strictly,
-          because a failure is not fatal usually, and Gate A20 is always
-          on some modern machines.  */
-       testb   %dl, %dl
-       jz      7f      
        call    gate_a20_check_state
        cmpb    %al, %dl
        /* everything failed, so restart from the beginning */
        jnz     gate_a20_try_bios
-7:     ret
+       ret
        
 gate_a20_check_state:
        /* iterate the checking for a while */