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.
This commit is contained in:
parent
b095e2adbf
commit
18eeaf04d7
2 changed files with 30 additions and 21 deletions
|
@ -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>
|
2008-07-18 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot
|
* kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot
|
||||||
|
|
|
@ -386,9 +386,32 @@ gate_a20_try_bios:
|
||||||
popl %ebp
|
popl %ebp
|
||||||
call gate_a20_check_state
|
call gate_a20_check_state
|
||||||
cmpb %al, %dl
|
cmpb %al, %dl
|
||||||
jnz gate_a20_try_keyboard_controller
|
jnz gate_a20_try_system_control_port_a
|
||||||
ret
|
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:
|
gate_a20_flush_keyboard_buffer:
|
||||||
inb $0x64
|
inb $0x64
|
||||||
andb $0x02, %al
|
andb $0x02, %al
|
||||||
|
@ -425,30 +448,11 @@ gate_a20_try_keyboard_controller:
|
||||||
outb $0x64
|
outb $0x64
|
||||||
call gate_a20_flush_keyboard_buffer
|
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
|
call gate_a20_check_state
|
||||||
cmpb %al, %dl
|
cmpb %al, %dl
|
||||||
/* everything failed, so restart from the beginning */
|
/* everything failed, so restart from the beginning */
|
||||||
jnz gate_a20_try_bios
|
jnz gate_a20_try_bios
|
||||||
7: ret
|
ret
|
||||||
|
|
||||||
gate_a20_check_state:
|
gate_a20_check_state:
|
||||||
/* iterate the checking for a while */
|
/* iterate the checking for a while */
|
||||||
|
|
Loading…
Reference in a new issue