LED_CAP 0x04 caps lock led
LEC_NUM 0x02 num lock led
LED_SCR 0x01 scroll lock led
Before 1.1.54, the LEDs just reflected the state of the corresponding keyboard flags, and KDGETLED/KDSETLED would also change the keyboard flags. Since 1.1.54 the leds can be made to display arbitrary information, but by default they display the keyboard flags. The following two ioctl's are used to access the keyboard flags.
KD_TEXT 0x00
KD_GRAPHICS 0x01
struct consolefontdesc { unsigned short charcount; /* characters in font (256 or 512) */ unsigned short charheight; /* scan lines per character (1-32) */ char *chardata; /* font data in expanded form */ };
If necessary, the screen will be appropriately resized, and SIGWINCH sent to the appropriate processes. This call also invalidates the Unicode mapping. (Since 1.3.1.)
struct unimapdesc { unsigned short entry_ct; struct unipair *entries; };
where entries points to an array of
struct unipair { unsigned short unicode; unsigned short fontpos; };
(Since 1.1.92.)
struct unimapinit { unsigned short advised_hashsize; /* 0 if no opinion */ unsigned short advised_hashstep; /* 0 if no opinion */ unsigned short advised_hashlevel; /* 0 if no opinion */ };
(Since 1.1.92.)
K_RAW 0x00
K_XLATE 0x01
K_MEDIUMRAW 0x02
K_UNICODE 0x03
K_METABIT 0x03 set high order bit
K_ESCPREFIX 0x04 escape prefix
struct kbentry { unsigned char kb_table; unsigned char kb_index; unsigned short kb_value; };
with the first two members filled in: kb_table selects the key table (0 <= kb_table < MAX_NR_KEYMAPS), and kb_index is the keycode (0 <= kb_index < NR_KEYS). kb_value is set to the corresponding action code, or K_HOLE if there is no such key, or K_NOSUCHMAP if kb_table is invalid.
struct kbsentry { unsigned char kb_func; unsigned char kb_string[512]; };
kb_string is set to the (NULL terminated) string corresponding to the kb_functh function key action code.
struct kbdiacrs { unsigned int kb_cnt; struct kbdiacr kbdiacr[256]; };
where kb_cnt is the number of entries in the array, each of which is a
struct kbdiacr { unsigned char diacr; unsigned char base; unsigned char result; };
struct kbkeycode { unsigned int scancode; unsigned int keycode; };
keycode is set to correspond to the given scancode. (89 <= scancode <= 255 only. For 1 <= scancode <= 88, keycode==scancode.) (Since 1.1.63.)
struct vt_mode { char mode; /* vt mode */ char waitv; /* if set, hang on writes if not active */ short relsig; /* signal to raise on release req */ short acqsig; /* signal to raise on acquisition */ short frsig; /* unused (set to 0) */ };
which is set to the mode of the active vt. mode is set to one of these values:
VT_AUTO auto vt switching
VT_PROCESS process controls switching
VT_ACKACQ acknowledge switch
struct vt_stat { unsigned short v_active; /* active vt */ unsigned short v_signal; /* signal to send */ unsigned short v_state; /* vt bit mask */ };
For each vt in use, the corresponding bit in the v_state member is set. (Kernels 1.0 through 1.1.92.)
struct vt_sizes { unsigned short v_rows; /* # rows */ unsigned short v_cols; /* # columns */ unsigned short v_scrollsize; /* no longer used */ };
Note that this does not change the videomode. See resizecons(8). (Since 1.1.54.)
struct vt_consize { unsigned short v_rows; /* number of rows */ unsigned short v_cols; /* number of columns */ unsigned short v_vlin; /* number of pixel rows on screen */ unsigned short v_clin; /* number of pixel rows per character */ unsigned short v_vcol; /* number of pixel columns on screen */ unsigned short v_ccol; /* number of pixel columns per character */ };
Any parameter may be set to zero, indicating "no change", but if multiple parameters are set, they must be self-consistent. Note that this does not change the videomode. See resizecons(8). (Since 1.3.3.)
The action of the following ioctls depends on the first byte in the struct pointed to by argp, referred to here as the subcode. These are legal only for the superuser or the owner of the current tty.
struct { char subcode; short xs, ys, xe, ye; short sel_mode; };xs and ys are the starting column and row. xe and ye are the ending column and row. (Upper left corner is row=column=1.) sel_mode is 0 for character-by-character selection, 1 for word-by-word selection, or 2 for line-by-line selection. The indicated screen characters are highlighted and saved in the static array sel_buffer in devices/char/console.c.
0: Screen blanking is disabled.
1: The current video adapter
register settings are saved, then the controller is programmed to turn off
the vertical synchronization pulses.
This puts the monitor into "standby" mode.
If your monitor has an Off_Mode timer, then
it will eventually power down by itself.
2: The current
settings are saved, then both the vertical and horizontal
synchronization pulses are turned off.
This puts the monitor into "off" mode.
If your monitor has no Off_Mode timer,
or if you want your monitor to power down immediately when the
blank_timer times out, then you choose this option.
(Caution: Powering down frequently will damage the monitor.)
(Since 1.1.76.)
Very often, ioctl's are introduced for communication between the kernel and one particular well-known program (fdisk, hdparm, setserial, tunelp, loadkeys, selection, setfont, etc.), and their behavior will be changed when required by this particular program.
Programs using these ioctl's will not be portable to other versions of Unix, will not work on older versions of Linux, and will not work on future versions of Linux.