diff options
Diffstat (limited to 'arch/x86/boot/main.c')
| -rw-r--r-- | arch/x86/boot/main.c | 19 | 
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c index 40358c8905b..fd6c9f23699 100644 --- a/arch/x86/boot/main.c +++ b/arch/x86/boot/main.c @@ -14,6 +14,7 @@   */  #include "boot.h" +#include "string.h"  struct boot_params boot_params __attribute__((aligned(16))); @@ -57,14 +58,20 @@ static void copy_boot_params(void)  }  /* - * Set the keyboard repeat rate to maximum.  Unclear why this + * Query the keyboard lock status as given by the BIOS, and + * set the keyboard repeat rate to maximum.  Unclear why the latter   * is done here; this might be possible to kill off as stale code.   */ -static void keyboard_set_repeat(void) +static void keyboard_init(void)  { -	struct biosregs ireg; +	struct biosregs ireg, oreg;  	initregs(&ireg); -	ireg.ax = 0x0305; + +	ireg.ah = 0x02;		/* Get keyboard status */ +	intcall(0x16, &ireg, &oreg); +	boot_params.kbd_status = oreg.al; + +	ireg.ax = 0x0305;	/* Set keyboard repeat rate */  	intcall(0x16, &ireg, NULL);  } @@ -151,8 +158,8 @@ void main(void)  	/* Detect memory layout */  	detect_memory(); -	/* Set keyboard repeat rate (why?) */ -	keyboard_set_repeat(); +	/* Set keyboard repeat rate (why?) and query the lock flags */ +	keyboard_init();  	/* Query MCA information */  	query_mca();  | 
