From 89513b6392f4d815be8794100d092f8d172d0b30 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Tue, 28 Feb 2012 21:06:38 +0000 Subject: [PATCH] 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 --- core/conio.c | 6 ++++-- 1 file 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(®s->eax.b[1]); } static void msg_setbg(char data) -- 2.7.4