From 74baff844e41ab6eb8391ba2d02194901e0146a5 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 6 Oct 2010 19:46:20 +0200 Subject: [PATCH] * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Fix incorrect handling of special keys. --- ChangeLog | 5 +++++ grub-core/kern/i386/pc/startup.S | 13 ++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61810897b..09b5d5c29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-10-09 Vladimir Serbinenko + + * grub-core/kern/i386/pc/startup.S (grub_console_getkey): Fix incorrect + handling of special keys. + 2010-10-02 Aleš Nesrsta * include/grub/scsi.h (grub_make_scsi_id): Fix incorrect usgae of diff --git a/grub-core/kern/i386/pc/startup.S b/grub-core/kern/i386/pc/startup.S index c4abc31b8..31bd86c65 100644 --- a/grub-core/kern/i386/pc/startup.S +++ b/grub-core/kern/i386/pc/startup.S @@ -615,6 +615,7 @@ LOCAL(bypass_table_end): FUNCTION(grub_console_getkey) pushl %ebp + pushl %edi call prot_to_real .code16 @@ -644,15 +645,16 @@ FUNCTION(grub_console_getkey) jz 1f andl %edx, %eax - cmp %eax, 0x20 + cmpl $0x20, %eax ja 2f movl %edx, %eax - leal LOCAL(bypass_table), %esi + leal LOCAL(bypass_table), %edi movl $((LOCAL(bypass_table_end) - LOCAL(bypass_table)) / 2), %ecx - repne cmpsw + repne scasw jz 3f - addl $('a' - 1 | GRUB_TERM_CTRL), %eax + andl $0xff, %eax + addl $(('a' - 1) | GRUB_TERM_CTRL), %eax jmp 2f 3: andl $0xff, %eax @@ -661,7 +663,8 @@ FUNCTION(grub_console_getkey) 1: movl %edx, %eax shrl $8, %eax orl $GRUB_TERM_EXTENDED, %eax -2: +2: + popl %edi popl %ebp ret