Annotation of coherent/f/usr/man/KERNEL/nkb, revision 1.1

1.1     ! root        1: nnkkbb -- Device Driver
        !             2: 
        !             3: 
        !             4: The COHERENT  device-driver nnkkbb  supports industry-standard 83-,  101-, and
        !             5: 102-key AT-protocol keyboards attached as the computer console.  Unlike kkbb,
        !             6: the other COHERENT keyboard driver, nnkkbb  lets you define both the layout of
        !             7: the keyboard  and the values returned  by function keys.  It  also lets you
        !             8: change  layout and  function-key  bindings by  using  the special  keyboard
        !             9: mapping programs kept in directory /ccoonnff/kkbbdd. This directory contains the C
        !            10: source code  for the mapping tables,  as well as a  MMaakkeeffiillee that helps you
        !            11: rebuild the mapping programs.   See the Lexicon article kkeeyybbooaarrdd ttaabblleess for
        !            12: details.
        !            13: 
        !            14: _K_e_r_n_e_l _V_a_r_i_a_b_l_e_s
        !            15: Please  note  that the  COHERENT  286 kernel  references  variables with  a
        !            16: trailing  underscore character;  for  example, aattppaarrmm_.   The COHERENT  386
        !            17: kernel, however, does _n_o_t use a trailing underscore; for example, aattppaarrmm.
        !            18: 
        !            19: The following descriptions apply to both COHERENT 286 and COHERENT 386, but
        !            20: the notation will be in the COHERENT-386 form.
        !            21: 
        !            22: _I_n_t_e_r_n_a_l _S_t_r_u_c_t_u_r_e
        !            23: The following paragraphs describe the internal structure of the nnkkbb driver.
        !            24: This information  is of interest  mainly to persons  who wish to  study the
        !            25: design of device drivers.
        !            26: 
        !            27: nnkkbb understands the following ``shift'' and ``lock'' keys:
        !            28: 
        !            29:      ssccrroollll    Scroll lock
        !            30:      nnuumm       Keypad NUM lock
        !            31:      ccaappss      Shift or CAPS lock
        !            32:      llaalltt      Left ALT key
        !            33:      rraalltt      Right ALT key
        !            34:      llsshhiifftt    Left SHIFT key
        !            35:      rrsshhiifftt    Right SHIFT key
        !            36:      llccttrrll     Left CTRL key
        !            37:      rrccttrrll     Right CTRL key
        !            38:      aallttggrr     ALT Graphic key (non-US keyboards)
        !            39: 
        !            40: nnkkbb records an internal shift state, as defined by the current positions of
        !            41: the  shift and  lock keys.   The shift  state is  a logical  combination of
        !            42: internal states  SSHHIIFFTT, CCTTRRLL, AALLTT,  and AALLTT_GGRR. The llsshhiifftt  and rrsshhiifftt keys
        !            43: combine  to   form  the  current  SSHHIIFFTT   state  for  non-alphabetic  keys.
        !            44: Alphabetic keys  generally use the  current state of  the ccaappss lock  key in
        !            45: addition to  llsshhiifftt and rrsshhiifftt. Numeric keys found  on the keypad generally
        !            46: use the state of the nnuumm  lock key combined with llsshhiifftt and rrsshhiifftt. The two
        !            47: ``control''  keys, llccttrrll  and rrccttrrll,  form the internal  CCTTRRLL state.   In a
        !            48: similar manner, the two ``alt'' keys,  llaalltt and rraalltt, form the internal AALLTT
        !            49: state.  Note that 102-key keyboards generally replace the rraalltt key with the
        !            50: aallttggrr key,  to allow access  to the alternate graphics  characters found on
        !            51: some keyboards.
        !            52: 
        !            53: nnkkbb  lets  you  configure or  read  the  internal  mapping  tables via  the
        !            54: following iiooccttll() requests, as defined in header file <ssggttttyy.hh>:
        !            55: 
        !            56:      TTIIOOCCGGEETTFF  Get function key bindings
        !            57:      TTIIOOCCSSEETTFF  Set function key bindings
        !            58:      TTIIOOCCGGEETTKKBBTTGet keyboard table bindings
        !            59:      TTIIOOCCSSEETTKKBBTTSet keyboard table bindings
        !            60: 
        !            61: Requests TTIIOOCCGGEETTFF  and TTIIOOCCSSEETTFF reference  a data structure  of type FFNNKKEEYY,
        !            62: which  is a  ttyyppeeddeeff defined  in header  file <ssyyss/kkbb.hh>.  Structure member
        !            63: kk_ffnnvvaall is a character array  that contains a series of contiguous function
        !            64: key/value bindings; the end of  the bindings is marked by manifest constant
        !            65: DDEELLIIMM. You  can use any  value other than  DDEELLIIMM as part  of a function-key
        !            66: binding.  Structure  member kk_nnffkkeeyyss indicates how  many function keys have
        !            67: associated entries in kk_ffnnvvaall. Function keys are numbered from zero through
        !            68: kk_nnffkkeeyyss-1.
        !            69: 
        !            70: _D_i_s_a_b_l_i_n_g <_C_t_r_l><_A_l_t><_D_e_l>
        !            71: By convention, function-key 0,  when enabled, causes the computer system to
        !            72: reboot.   This   function  key  is  usually  bound   to  the  key  sequence
        !            73: <ccttrrll><aalltt><ddeell>, but  you can disable  it by setting the  value of driver-
        !            74: variable KKBBBBOOOOTT to zero.  To do so, use the following command:
        !            75: 
        !            76:     /conf/patch /coherent KBBOOT=0
        !            77: 
        !            78: Requests  TTIIOOCCGGEETTKKBBTT  and  TTIIOOCCSSEETTKKBBTT  reference  an  array  that  contains
        !            79: MMAAXX_KKEEYYSS occurrences of data structure KKBBTTBBLL, which is a ttyyppeeddeeff defined in
        !            80: header file  <ssyyss/kkbb.hh>. Structure member kk_kkeeyy contains  the _s_c_a_n _c_o_d_e _s_e_t
        !            81: _t_h_r_e_e code value for  the desired key.  Header file <ssyyss/kkbbssccaann.hh> contains
        !            82: manifest  (symbolic) constants  of the  form KK__n_n_n,  which map  AT keyboard
        !            83: _p_h_y_s_i_c_a_l  key number  _n_n_n to  the  corresponding scan-code  set-three value
        !            84: generated by the keyboard.  Note that the nnkkbb driver disables the scan-code
        !            85: translation  that the  keyboard controller  normally  performs, as  well as
        !            86: setting the keyboard to scan code set three.
        !            87: 
        !            88: Structure  member  kk_vvaall is  a  nine-element array  that  contains the  key
        !            89: mappings that correspond to the following index values and shift states:
        !            90: 
        !            91:     00   BBAASSEE
        !            92:     11   SSHHIIFFTT
        !            93:     22   CCTTRRLL
        !            94:     33   CCTTRRLL_SSHHIIFFTT
        !            95:     44   AALLTT
        !            96:     55   AALLTT_SSHHIIFFTT
        !            97:     66   AALLTT_CCTTRRLL
        !            98:     77   AALLTT_CCTTRRLL_SSHHIIFFTT
        !            99:     88   AALLTT_GGRR
        !           100: 
        !           101: Structure member kk_ffllaaggss contains  mode information for the given key.  One
        !           102: field  in kk_ffllaaggss  indicates the  _c_l_a_s_s  of key.   This sub-field  lets you
        !           103: specify whether a  key is a ``shift'' key (as  defined above), a special or
        !           104: programmable  ``function''  key,  or  a  ``regular''  key.   The  following
        !           105: symbolic constants specify the _c_l_a_s_s of key:
        !           106: 
        !           107: SS    The  specified key  is a  ``shift''  or ``lock''  key.  Note  that all
        !           108:      entries in  array kk_vvaall must be identical for  a ``shift'' or ``lock''
        !           109:      key to work correctly.
        !           110: 
        !           111: FF    The specified key is a ``function''  or special key.  The value of all
        !           112:      elements  of array  kk_vvaall  must specify  a function  key number.   See
        !           113:      header file <kkbb.hh> for a list of predefined function keys.
        !           114: 
        !           115: OO    The specified key is ``regular'' and requires no special processing.
        !           116: 
        !           117: The next  sub-field of kk_ffllaaggss specifies  the _t_y_p_e of key,  as specified in
        !           118: the AT  keyboard technical reference.   The _t_y_p_e sub-field  specifies under
        !           119: what  conditions a  given  key will  generate an  interrupt.  The  possible
        !           120: choices are:
        !           121: 
        !           122: MM    Make: generate an interrupt only upon key ``make'' (i.e., when the key
        !           123:      is  depressed).  This  mode is  useful for keys  which do  not repeat.
        !           124:      Note  that  using  this  mode  with  ``shift''  keys  stops  you  from
        !           125:      unshifting upon release of the key!
        !           126: 
        !           127: TT    Typematic:  generate  an  interrupt when  the  key  is depressed,  and
        !           128:      generate  subsequent  key-depression   interrupts  while  the  key  is
        !           129:      depressed.  The rate at which interrupts are generated is specified by
        !           130:      the typematic  rate of the keyboard.  This  type is usually associated
        !           131:      with a ``regular'' key.
        !           132: 
        !           133: MMBB   Make/Break: generate an interrupt  when the key is depressed, and when
        !           134:      it is released.  No  additional interrupts are generated no matter how
        !           135:      long the key is depressed.  This mode is used for ``shift'' keys.
        !           136: 
        !           137: TTMMBB  Typematic/Make/Break:  generate an  interrupt  when the  key is  first
        !           138:      depressed; generate subsequent key depression interrupts while the key
        !           139:      remains depressed; and generate an interrupt when the key is released.
        !           140: 
        !           141: The last sub-field of kk_ffllaaggss specifies  the _l_o_c_k keys, if any, that affect
        !           142: the specified key:
        !           143: 
        !           144: CC    The ccaappss  lock key  that affects  this key.  If  the specified  key is
        !           145:      depressed while  ccaappss lock is active, it is  equivalent to having used
        !           146:      either of the SHIFT keys with  this key.  When ccaappss lock is in effect,
        !           147:      use of either  of the SHIFT keys temporarily toggles  the state of the
        !           148:      ccaappss lock.
        !           149: 
        !           150: NN    The nnuumm lock key affects this  key.  If the specified key is depressed
        !           151:      while nnuumm  lock is active, it  is equivalent to having  used either of
        !           152:      the SHIFT  keys in conjunction with the specified  key.  When nnuumm lock
        !           153:      is in effect, use of either  of the SHIFT keys temporarily toggles the
        !           154:      state of the nnuumm lock.
        !           155: 
        !           156: _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
        !           157: If  you are  experiencing problems  with respect to  key mappings,  and you
        !           158: installed one  of the  loadable keyboard  mapping tables from  the keyboard
        !           159: selection menu,  you may have  an incompatible keyboard.   Please note that
        !           160: the  COHERENT  nnkkbb  driver  (and  loadable  tables) only  work  with  well-
        !           161: engineered keyboards,  such as those built by  IBM, Cherry, MicroSwitch, or
        !           162: Keytronics; when  used with a poorly engineered  ``clone'' keyboard, it may
        !           163: not work correctly.
        !           164: 
        !           165: The preferred action  is to replace the inferior keyboard  with one made by
        !           166: one  of the  above-named manufacturers.   If, however, you  wish to  use an
        !           167: inferior keyboard  with COHERENT, your  best bet is  to re-install COHERENT
        !           168: and select  the kkbb driver instead  of nnkkbb. kkbb is  not loadable and supports
        !           169: only the U.S., German, and French keyboard layouts.
        !           170: 
        !           171: If you  do not wish to  replace your keyboard or  re-install COHERENT, then
        !           172: the following _m_a_y help you cope with your keyboard's problems.
        !           173: 
        !           174: 11. If  the shift  or  control keys  seem  to ``stick''  in the  oonn or  ddoowwnn
        !           175:    postition,  you  can  try   to  fix  the  keyboard  mapping  table  that
        !           176:    corresponds  to your  country.  For  example, if  you selected  the U.S.
        !           177:    keyboard mapping table during installation but find that the right shift
        !           178:    or control key seems to stay down after you press it for the first time,
        !           179:    edit file  /ccoonnff/kkbbdd/uuss.cc. To fix  the right shift key,  change the line
        !           180:    that reads:
        !           181: 
        !           182:    {K_57,rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift,rshift, S|MB },
        !           183:    to:
        !           184: 
        !           185:    {K_57,none, none, none, none, none, none, none, none, none, O|MB },
        !           186:    To fix the right control key, change the line that reads
        !           187: 
        !           188:    {K_64, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, rctrl, S|MB },
        !           189:    to:
        !           190: 
        !           191:    {K_64,none, none, none, none, none, none, none, none, none, O|MB },
        !           192:    This  makes  these keys  inoperative.   This, of  course,  is less  than
        !           193:    desirable, but it will at least prevent you from accidently forcing your
        !           194:    keyboard into a shift or control state from which you cannot exit.
        !           195: 
        !           196:    Once you  modified the keyboard  table, rebuild the  keyboard executable
        !           197:    that corresponds  to the modified  table, as described above  and in the
        !           198:    Lexicon article  kkeeyybbooaarrdd ttaabblleess. Thereafter, you can  enter the name of
        !           199:    the  newly  created executable  and it  will load the  modified keyboard
        !           200:    table into the keyboard driver.  This also happens automatically at boot
        !           201:    time.
        !           202: 
        !           203: 22. If  one or  two  keys are  transposed,  have no  output,  or output  the
        !           204:    incorrect  value,  you  must  (a)  figure  out  which  key  location  is
        !           205:    incorrect,  (b) decide  what the  correct  value should  be for  all key
        !           206:    states, (c)  edit the  file in  directory /ccoonnff/kkbbdd that  corresponds to
        !           207:    your  selection, (d)  rebuild  the keyboard  table  executable, and  (e)
        !           208:    reload the keyboard table by invoking the newly created executable.
        !           209: 
        !           210: As noted above, the easiest solution is to replace the keyboard.
        !           211: 
        !           212: _S_e_e _A_l_s_o
        !           213: ddeevviiccee ddrriivveerrss, ffnnkkeeyy, kkbb.hh, kkeeyybbooaarrdd ttaabblleess
        !           214: _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,
        !           215: 1984.
        !           216: _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.
        !           217: 
        !           218: _N_o_t_e_s
        !           219: With  release 3.2  of COHERENT,  nnkkbb became  the standard  keyboard driver,
        !           220: replacing the kkbb driver used  in earlier releases.  Please note that either
        !           221: nnkkbb or kkbb can be linked  into the COHERENT kernel, like most other COHERENT
        !           222: device drivers.  Neither driver  is found in directory /ddrrvv; this directory
        !           223: is reserved for loadable device drivers, such as those for the COM ports or
        !           224: for  the shared-memory  driver.  The  COHERENT  Device Driver  Kit contains
        !           225: tools and information to rebuild the COHERENT kernel, which is necessary if
        !           226: you wish to switch keyboard drivers.
        !           227: 
        !           228: The main difference between nnkkbb and  kkbb is that nnkkbb uses a ``supplemental''
        !           229: process  to interpret  keystrokes.  This permits  COHERENT users  to switch
        !           230: among flavors of international  keyboards with a minimum of difficulty.  As
        !           231: noted above,  the source  code for these  supplemental programs is  kept in
        !           232: directory  /ccoonnff/kkbbdd.  See  the Lexicon  article  on   kkeeyybbooaarrdd ttaabblleess  for
        !           233: details  on  how  to modify,  compile,  and  load  one  of these  keyboard-
        !           234: interpretation programs.
        !           235: 
        !           236: Please note,  finally, that  if you attempt  to use a  keyboard interpreter
        !           237: 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.