Re: [RESUBMIT] [PATCH] Use BIOS Keyboard variable to set Numlock

From: Joshua C.
Date: Tue Feb 28 2012 - 04:14:09 EST


2012/2/28 H. Peter Anvin <hpa@xxxxxxxxx>:
> On 02/27/2012 04:08 PM, Joshua C. wrote:
>>
>> If so I'm not sure about it. We check the BIOS data area as defined
>> for IBM PCs (1981), so a fair amount of user should benefit from the
>> change. Those non-BIOS boots can set the numlock=0 and won't be
>> affected by this. I think this isa lot easier to implement than doing
>> it in the BIOS bootstrap code.
>>
>
> Here is a patch to query the BIOS state properly; if you could fill out
> the rest of the patch then we can merge this in easily enough.
>
>        -hpa

I think this should be the missing part:

@@ -1432,7 +1439,17 @@ int __init kbd_init(void)
{
int i;
int error;
-
+
+#ifdef CONFIG_KBD_DEFLEDS_PCBIOS
+ int KBD_DEFLEDS = 0;
+ char * bios_kbd_lock_status=boot_params.kbd_status
+
+ /* Numlock status bit set? */
+ if ((*bios_kbd_lock_status & 0x20) && numlock)
+ KBD_DEFLEDS = 1 << VC_NUMLOCK;
+#endif
+
for (i = 0; i < MAX_NR_CONSOLES; i++) {
kbd_table[i].ledflagstate = KBD_DEFLEDS;
kbd_table[i].default_ledflagstate = KBD_DEFLEDS;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/