diff --git a/ChangeLog b/ChangeLog index eb26bb11d..d40e7420c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-15 Bean + + * kern/i386/pc/startup.S (grub_console_getkey): Workaround for the + keyboard hang problem in apple's intel mac. + 2008-05-09 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 5d4bbcb99..ebb98fe60 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1240,6 +1240,23 @@ 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. + */ + +1: + movb $1, %ah + int $0x16 + jnz 2f + hlt + jmp 1b + +2: + + movb $0, %ah int $0x16 movw %ax, %dx /* real_to_prot uses %eax */