[syslinux:elflink] core: Check for func key in getchar()

syslinux-bot for Matt Fleming matt.fleming at intel.com
Mon Mar 26 15:36:04 PDT 2012


Commit-ID:  89513b6392f4d815be8794100d092f8d172d0b30
Gitweb:     http://www.syslinux.org/commit/89513b6392f4d815be8794100d092f8d172d0b30
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 28 Feb 2012 21:06:38 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 23 Mar 2012 16:34:41 +0000

core: Check for func key in getchar()

We need to return the value stored in ah after reading from the
keyboard with __intcall(0x16, ...) otherwise we won't properly detect
function keys such as F1, F2, etc.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

---
 core/conio.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/conio.c b/core/conio.c
index 5ed0b4b..70dd3b1 100644
--- a/core/conio.c
+++ b/core/conio.c
@@ -265,7 +265,7 @@ extern void do_idle(void);
 /*
  * getchar: Read a character from keyboard or serial port
  */
-char getchar(void)
+char getchar(char *hi)
 {
 	com32sys_t ireg, oreg;
 	unsigned char data;
@@ -313,6 +313,8 @@ char getchar(void)
 			__intcall(0x16, &ireg, &oreg);
 
 			data = oreg.eax.b[0];
+			*hi = oreg.eax.b[1];
+
 			if (data == 0xE0)
 				data = 0;
 
@@ -331,7 +333,7 @@ char getchar(void)
 
 void pm_getchar(com32sys_t *regs)
 {
-	regs->eax.b[0] = getchar();
+	regs->eax.b[0] = getchar(&regs->eax.b[1]);
 }
 
 static void msg_setbg(char data)


More information about the Syslinux-commits mailing list