aboutsummaryrefslogtreecommitdiffstats
path: root/com32/menu
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2014-04-17 20:38:11 -0700
committerH. Peter Anvin <hpa@zytor.com>2014-04-17 20:38:11 -0700
commitfdad168405fd97471f5086dee84b2ebe14e314d3 (patch)
treeb17be9a4e4c8d134b835468fe4b2940f1d46bb88 /com32/menu
parentde403416f573e2e6f8c88a90b882dd5e071fb7f0 (diff)
downloadsyslinux-fdad168405fd97471f5086dee84b2ebe14e314d3.tar.gz
syslinux-fdad168405fd97471f5086dee84b2ebe14e314d3.tar.xz
syslinux-fdad168405fd97471f5086dee84b2ebe14e314d3.zip
bios: Use int 0x16, ah=0x02 to probe for shift flagssyslinux-6.03-pre10
At least one USB keyboard BIOS has been reported to not properly handle the keyboard flags in memory. See if actually using INT 16h works better. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/menu')
-rw-r--r--com32/menu/menumain.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index a3061ede..fc1376eb 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009-2011 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2014 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -611,9 +611,17 @@ static const char *edit_cmdline(const char *input, int top)
static inline int shift_is_held(void)
{
- uint8_t shift_bits = *(uint8_t *) 0x417;
+#ifdef __FIRMWARE_BIOS__
+ com32sys_t reg;
- return !!(shift_bits & 0x5d); /* Caps/Scroll/Alt/Shift */
+ memset(&reg, 0, sizeof reg);
+ reg.eax.b[1] = 0x02;
+ __intcall(0x16, &reg, &reg);
+
+ return !!(reg.eax.b[0] & 0x5d); /* Caps/Scroll/Alt/Shift */
+#else
+ return 0; /* Need to implement this */
+#endif
}
static void print_timeout_message(int tol, int row, const char *msg)