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

From: Joshua C.
Date: Wed Feb 29 2012 - 17:56:50 EST


2012/2/29 H. Peter Anvin <hpa@xxxxxxxxx>:
> On 02/29/2012 03:43 AM, Joshua C. wrote:
>>
>>
>> I got the idea that we should somehow check the kbd_state and set the
>> numlock accordingly but this is behind my capabilities. I tried
>> several times to read those boot_params but I have no idea how to do
>> it. Where are they stored, how to access them? Help anyone?
>>
>
> There is a global variable called boot_params; the prototype for it is
> defined in <asm/setup.h>.
>
> So as long as you are on an x86 architecture you can just #include
> <asm/setup.h> and just access the boot_params structure directly (with the
> patch provided to add the new field.)
>
>        -hpa

I think I figured it out. This is the patch I tested on a desktop and
a laptop and it works the way it should.
--------------