[syslinux] [PATCH 06/19] core: Check for func key in getchar()

Matt Fleming matt at console-pimps.org
Fri Mar 23 11:02:40 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

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)
-- 
1.7.4.4




More information about the Syslinux mailing list