lkml.org 
[lkml]   [2008]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Default keyboard LEDs
Samuel Thibault wrote:
> In many cases, one prefers to have e.g. the NumLock on by default. In
> many cases, one doesn't want to have it by default, e.g. on laptops.
>
> Distributions actually have a very hard time trying to set this
> correctly after the kernel boot, and that doesn't work for new consoles
> that are created via the openvt(1) command anyway. This hence adds a
> keyboard.default_leds boot parameter that permits to configure the
> default keyboard LEDs.
>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
>
> Actually, what would be perfect would be to use the configuration that
> the BIOS sets at boot by default. That is device-dependent, however.
>

It is, but it can be read out either by INT calls at initialization
time, or by reading out the byte at physical address 0x417:

--------K-M00400017--------------------------
MEM 0040h:0017h - KEYBOARD - STATUS FLAGS 1
Size: BYTE
SeeAlso: MEM 0040h:0018h,INT 16/AH=02h,MEM 0040h:0096h
Bitfields for keyboard status flags 1:
Bit(s) Description (Table M0010)
7 INSert active
6 Caps Lock active
5 Num Lock active
4 Scroll Lock active
3 either Alt pressed
2 either Ctrl pressed
1 Left Shift pressed
0 Right Shift pressed
SeeAlso: #M0011,#00587

The same information is available through INT 16h, AH=02h.

-hpa


\
 
 \ /
  Last update: 2008-01-14 04:53    [W:0.137 / U:0.500 seconds]
©2003-2014 Jasper Spaans. Advertise on this site