File:  [MW Coherent from dump] / coherent / f / usr / man / KERNEL / nkb
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:40 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

nnkkbb -- Device Driver


The COHERENT  device-driver nnkkbb  supports industry-standard 83-,  101-, and
102-key AT-protocol keyboards attached as the computer console.  Unlike kkbb,
the other COHERENT keyboard driver, nnkkbb  lets you define both the layout of
the keyboard  and the values returned  by function keys.  It  also lets you
change  layout and  function-key  bindings by  using  the special  keyboard
mapping programs kept in directory /ccoonnff/kkbbdd. This directory contains the C
source code  for the mapping tables,  as well as a  MMaakkeeffiillee that helps you
rebuild the mapping programs.   See the Lexicon article kkeeyybbooaarrdd ttaabblleess for
details.

_K_e_r_n_e_l _V_a_r_i_a_b_l_e_s
Please  note  that the  COHERENT  286 kernel  references  variables with  a
trailing  underscore character;  for  example, aattppaarrmm_.   The COHERENT  386
kernel, however, does _n_o_t use a trailing underscore; for example, aattppaarrmm.

The following descriptions apply to both COHERENT 286 and COHERENT 386, but
the notation will be in the COHERENT-386 form.

_I_n_t_e_r_n_a_l _S_t_r_u_c_t_u_r_e
The following paragraphs describe the internal structure of the nnkkbb driver.
This information  is of interest  mainly to persons  who wish to  study the
design of device drivers.

nnkkbb understands the following ``shift'' and ``lock'' keys:

     ssccrroollll    Scroll lock
     nnuumm       Keypad NUM lock
     ccaappss      Shift or CAPS lock
     llaalltt      Left ALT key
     rraalltt      Right ALT key
     llsshhiifftt    Left SHIFT key
     rrsshhiifftt    Right SHIFT key
     llccttrrll     Left CTRL key
     rrccttrrll     Right CTRL key
     aallttggrr     ALT Graphic key (non-US keyboards)

nnkkbb records an internal shift state, as defined by the current positions of
the  shift and  lock keys.   The shift  state is  a logical  combination of
internal states  SSHHIIFFTT, CCTTRRLL, AALLTT,  and AALLTT_GGRR. The llsshhiifftt  and rrsshhiifftt keys
combine  to   form  the  current  SSHHIIFFTT   state  for  non-alphabetic  keys.
Alphabetic keys  generally use the  current state of  the ccaappss lock  key in
addition to  llsshhiifftt and rrsshhiifftt. Numeric keys found  on the keypad generally
use the state of the nnuumm  lock key combined with llsshhiifftt and rrsshhiifftt. The two
``control''  keys, llccttrrll  and rrccttrrll,  form the internal  CCTTRRLL state.   In a
similar manner, the two ``alt'' keys,  llaalltt and rraalltt, form the internal AALLTT
state.  Note that 102-key keyboards generally replace the rraalltt key with the
aallttggrr key,  to allow access  to the alternate graphics  characters found on
some keyboards.

nnkkbb  lets  you  configure or  read  the  internal  mapping  tables via  the
following iiooccttll() requests, as defined in header file <ssggttttyy.hh>:

     TTIIOOCCGGEETTFF  Get function key bindings
     TTIIOOCCSSEETTFF  Set function key bindings
     TTIIOOCCGGEETTKKBBTTGet keyboard table bindings
     TTIIOOCCSSEETTKKBBTTSet keyboard table bindings

Requests TTIIOOCCGGEETTFF  and TTIIOOCCSSEETTFF reference  a data structure  of type FFNNKKEEYY,
which  is a  ttyyppeeddeeff defined  in header  file <ssyyss/kkbb.hh>.  Structure member
kk_ffnnvvaall is a character array  that contains a series of contiguous function
key/value bindings; the end of  the bindings is marked by manifest constant
DDEELLIIMM. You  can use any  value other than  DDEELLIIMM as part  of a function-key
binding.  Structure  member kk_nnffkkeeyyss indicates how  many function keys have
associated entries in kk_ffnnvvaall. Function keys are numbered from zero through
kk_nnffkkeeyyss-1.

_D_i_s_a_b_l_i_n_g <_C_t_r_l><_A_l_t><_D_e_l>
By convention, function-key 0,  when enabled, causes the computer system to
reboot.   This   function  key  is  usually  bound   to  the  key  sequence
<ccttrrll><aalltt><ddeell>, but  you can disable  it by setting the  value of driver-
variable KKBBBBOOOOTT to zero.  To do so, use the following command:

    /conf/patch /coherent KBBOOT=0

Requests  TTIIOOCCGGEETTKKBBTT  and  TTIIOOCCSSEETTKKBBTT  reference  an  array  that  contains
MMAAXX_KKEEYYSS occurrences of data structure KKBBTTBBLL, which is a ttyyppeeddeeff defined in
header file  <ssyyss/kkbb.hh>. Structure member kk_kkeeyy contains  the _s_c_a_n _c_o_d_e _s_e_t
_t_h_r_e_e code value for  the desired key.  Header file <ssyyss/kkbbssccaann.hh> contains
manifest  (symbolic) constants  of the  form KK__n_n_n,  which map  AT keyboard
_p_h_y_s_i_c_a_l  key number  _n_n_n to  the  corresponding scan-code  set-three value
generated by the keyboard.  Note that the nnkkbb driver disables the scan-code
translation  that the  keyboard controller  normally  performs, as  well as
setting the keyboard to scan code set three.

Structure  member  kk_vvaall is  a  nine-element array  that  contains the  key
mappings that correspond to the following index values and shift states:

    00   BBAASSEE
    11   SSHHIIFFTT
    22   CCTTRRLL
    33   CCTTRRLL_SSHHIIFFTT
    44   AALLTT
    55   AALLTT_SSHHIIFFTT
    66   AALLTT_CCTTRRLL
    77   AALLTT_CCTTRRLL_SSHHIIFFTT
    88   AALLTT_GGRR

Structure member kk_ffllaaggss contains  mode information for the given key.  One
field  in kk_ffllaaggss  indicates the  _c_l_a_s_s  of key.   This sub-field  lets you
specify whether a  key is a ``shift'' key (as  defined above), a special or
programmable  ``function''  key,  or  a  ``regular''  key.   The  following
symbolic constants specify the _c_l_a_s_s of key:

SS    The  specified key  is a  ``shift''  or ``lock''  key.  Note  that all
     entries in  array kk_vvaall must be identical for  a ``shift'' or ``lock''
     key to work correctly.

FF    The specified key is a ``function''  or special key.  The value of all
     elements  of array  kk_vvaall  must specify  a function  key number.   See
     header file <kkbb.hh> for a list of predefined function keys.

OO    The specified key is ``regular'' and requires no special processing.

The next  sub-field of kk_ffllaaggss specifies  the _t_y_p_e of key,  as specified in
the AT  keyboard technical reference.   The _t_y_p_e sub-field  specifies under
what  conditions a  given  key will  generate an  interrupt.  The  possible
choices are:

MM    Make: generate an interrupt only upon key ``make'' (i.e., when the key
     is  depressed).  This  mode is  useful for keys  which do  not repeat.
     Note  that  using  this  mode  with  ``shift''  keys  stops  you  from
     unshifting upon release of the key!

TT    Typematic:  generate  an  interrupt when  the  key  is depressed,  and
     generate  subsequent  key-depression   interrupts  while  the  key  is
     depressed.  The rate at which interrupts are generated is specified by
     the typematic  rate of the keyboard.  This  type is usually associated
     with a ``regular'' key.

MMBB   Make/Break: generate an interrupt  when the key is depressed, and when
     it is released.  No  additional interrupts are generated no matter how
     long the key is depressed.  This mode is used for ``shift'' keys.

TTMMBB  Typematic/Make/Break:  generate an  interrupt  when the  key is  first
     depressed; generate subsequent key depression interrupts while the key
     remains depressed; and generate an interrupt when the key is released.

The last sub-field of kk_ffllaaggss specifies  the _l_o_c_k keys, if any, that affect
the specified key:

CC    The ccaappss  lock key  that affects  this key.  If  the specified  key is
     depressed while  ccaappss lock is active, it is  equivalent to having used
     either of the SHIFT keys with  this key.  When ccaappss lock is in effect,
     use of either  of the SHIFT keys temporarily toggles  the state of the
     ccaappss lock.

NN    The nnuumm lock key affects this  key.  If the specified key is depressed
     while nnuumm  lock is active, it  is equivalent to having  used either of
     the SHIFT  keys in conjunction with the specified  key.  When nnuumm lock
     is in effect, use of either  of the SHIFT keys temporarily toggles the
     state of the nnuumm lock.

_P_r_o_b_l_e_m_s _W_i_t_h _I_n_c_o_m_p_a_t_i_b_l_e _K_e_y_b_o_a_r_d_s
If  you are  experiencing problems  with respect to  key mappings,  and you
installed one  of the  loadable keyboard  mapping tables from  the keyboard
selection menu,  you may have  an incompatible keyboard.   Please note that
the  COHERENT  nnkkbb  driver  (and  loadable  tables) only  work  with  well-
engineered keyboards,  such as those built by  IBM, Cherry, MicroSwitch, or
Keytronics; when  used with a poorly engineered  ``clone'' keyboard, it may
not work correctly.

The preferred action  is to replace the inferior keyboard  with one made by
one  of the  above-named manufacturers.   If, however, you  wish to  use an
inferior keyboard  with COHERENT, your  best bet is  to re-install COHERENT
and select  the kkbb driver instead  of nnkkbb. kkbb is  not loadable and supports
only the U.S., German, and French keyboard layouts.

If you  do not wish to  replace your keyboard or  re-install COHERENT, then
the following _m_a_y help you cope with your keyboard's problems.

11. If  the shift  or  control keys  seem  to ``stick''  in the  oonn or  ddoowwnn
   postition,  you  can  try   to  fix  the  keyboard  mapping  table  that
   corresponds  to your  country.  For  example, if  you selected  the U.S.
   keyboard mapping table during installation but find that the right shift
   or control key seems to stay down after you press it for the first time,
   edit file  /ccoonnff/kkbbdd/uuss.cc. To fix  the right shift key,  change the line
   that reads:

   {K_57,rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift, S|MB },
   to:

   {K_57,none, none, none, none, none, none, none, none, none, O|MB },
   To fix the right control key, change the line that reads

   {K_64, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, S|MB },
   to:

   {K_64,none, none, none, none, none, none, none, none, none, O|MB },
   This  makes  these keys  inoperative.   This, of  course,  is less  than
   desirable, but it will at least prevent you from accidently forcing your
   keyboard into a shift or control state from which you cannot exit.

   Once you  modified the keyboard  table, rebuild the  keyboard executable
   that corresponds  to the modified  table, as described above  and in the
   Lexicon article  kkeeyybbooaarrdd ttaabblleess. Thereafter, you can  enter the name of
   the  newly  created executable  and it  will load the  modified keyboard
   table into the keyboard driver.  This also happens automatically at boot
   time.

22. If  one or  two  keys are  transposed,  have no  output,  or output  the
   incorrect  value,  you  must  (a)  figure  out  which  key  location  is
   incorrect,  (b) decide  what the  correct  value should  be for  all key
   states, (c)  edit the  file in  directory /ccoonnff/kkbbdd that  corresponds to
   your  selection, (d)  rebuild  the keyboard  table  executable, and  (e)
   reload the keyboard table by invoking the newly created executable.

As noted above, the easiest solution is to replace the keyboard.

_S_e_e _A_l_s_o
ddeevviiccee ddrriivveerrss, ffnnkkeeyy, kkbb.hh, kkeeyybbooaarrdd ttaabblleess
_T_e_c_h_n_i_c_a_l  _R_e_f_e_r_e_n_c_e _f_o_r  _t_h_e _I_B_M  _P_e_r_s_o_n_a_l  _C_o_m_p_u_t_e_r _A_T,  IBM Corporation,
1984.
_M_u_l_t_i-_F_u_n_c_t_i_o_n _K_e_y_b_o_a_r_d_s: _L_a_y_o_u_t_s, Cherry Electrical Products Corp.

_N_o_t_e_s
With  release 3.2  of COHERENT,  nnkkbb became  the standard  keyboard driver,
replacing the kkbb driver used  in earlier releases.  Please note that either
nnkkbb or kkbb can be linked  into the COHERENT kernel, like most other COHERENT
device drivers.  Neither driver  is found in directory /ddrrvv; this directory
is reserved for loadable device drivers, such as those for the COM ports or
for  the shared-memory  driver.  The  COHERENT  Device Driver  Kit contains
tools and information to rebuild the COHERENT kernel, which is necessary if
you wish to switch keyboard drivers.

The main difference between nnkkbb and  kkbb is that nnkkbb uses a ``supplemental''
process  to interpret  keystrokes.  This permits  COHERENT users  to switch
among flavors of international  keyboards with a minimum of difficulty.  As
noted above,  the source  code for these  supplemental programs is  kept in
directory  /ccoonnff/kkbbdd.  See  the Lexicon  article  on   kkeeyybbooaarrdd ttaabblleess  for
details  on  how  to modify,  compile,  and  load  one  of these  keyboard-
interpretation programs.

Please note,  finally, that  if you attempt  to use a  keyboard interpreter
with kkbb, it will fail with an error message.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.