home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / ibm / pc / hardware / 20076 < prev    next >
Encoding:
Text File  |  1992-07-22  |  6.5 KB  |  132 lines

  1. Newsgroups: comp.sys.ibm.pc.hardware
  2. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.iastate.edu!rjhoffma
  3. From: rjhoffma@iastate.edu (Richard J. Hoffmann)
  4. Subject: Keyboard, BIOS problem: Stuck shift key
  5. Message-ID: <1992Jul22.153227.8440@news.iastate.edu>
  6. Keywords: Keyboard, BIOS, INT 9
  7. Sender: news@news.iastate.edu (USENET News System)
  8. Organization: Iowa State University, Ames, IA
  9. Distribution: usa
  10. Date: Wed, 22 Jul 1992 15:32:27 GMT
  11. Lines: 119
  12.  
  13. I have a 486-33 with a generic clone motherboard (Taiwanese, no
  14. name that I can find) with an AMI BIOS.  The machine has a problem
  15. handling the enhanced keyboard.  Specifically, the keyboard often
  16. spontaneously locks as if all keys are shifted.  Also, the
  17. enhanced keys, including the arrows, Delete, PgUp, etc., sometimes
  18. return their equivalents on the numeric keypad (e.g., the enhanced
  19. arrows return 4, 8, 6, or 2, depending on which is used).  The
  20. latter seems to be cured if I turn off the numbers lock.  The
  21. "stuck" shift key (and once the control key) problem persists.
  22.  
  23. The problem is apparently not peculiar to my machine.  The dealer
  24. has three customers with a similar complaint.  Initially they
  25. blamed the problem on WordPerfect 5.1, but I have the trouble in a
  26. variety of settings.  It's especially bad when I connect to a DEC
  27. system through the ethernet.  They replaced the keyboard BIOS
  28. without effect.
  29.  
  30. WordPerfect suggested trying software fixes supplied from their
  31. BBS that fiddle with the handling of INT 9.  These don't fix the
  32. problem for me.
  33.  
  34. If anyone has heard of this problem, and especially if you know
  35. the solution, I'd be grateful to hear it.  The dealer is baffled,
  36. and I have a unit that is hard to use.  The discussion supplied
  37. with the files from WordPerfect implies that this could be an AT-
  38. BIOS problem, something I guess wouldn't be traceable specifically
  39. to AMI.
  40.  
  41. In case it helps, I've attached below the discussion of the
  42. problem that was included with the files I got from WordPerfect.
  43.  
  44. Dick Hoffmann
  45. rjhoffma@iastate.edu
  46.  
  47.    KBFIX.DOC    18-Apr-1990
  48.  
  49.    A problem involving incorrect keyboard data has been reported by
  50.    several LANtastic user's. When using enhanced (101-key) keyboards
  51.    with NUM-lock on, a "Left-shift on" state occasionally becomes active
  52.    when no shift key is depressed. The state can be cleared by pressing
  53.    and releasing the left shift key. Also, on some machines, an enhanced
  54.    key (Arrows, Insert, Delete, Home, End, PageUp, PageDown) are
  55.    occassionally decoded as their numeric keypad NUMlocked equivalents,
  56.    e.g. "2", "4", "6", etc.
  57.  
  58.    The problem seems to stem from the fact that the enhanced keyboards
  59.    send a string of scan codes (4 scan codes when NUMlock is on) for
  60.    each press or release of the key. An E0 scan code precedes each of
  61.    the others, to indicate that the following scan code is to be interpreted
  62.    as "enhanced".
  63.  
  64.    These four scan code are sent in rapid succession to the PC motherboard.
  65.    As each is received, an IRQ1 is activated, which invokes the ISR for
  66.    INT 09H. This ISR is initially set to the BIOS keyboard handler,
  67.    although it is later re-hooked by resident drivers such as REDIR.
  68.    One of the first things the AT-BIOS handler does is to inhibit the
  69.    keyboard from sending further scan codes until processing of the one
  70.    causing the interrupt is complete.
  71.  
  72.    Unfortunately, before it does this, AT-BIOS executes an STI intruction,
  73.    allowing other interrupts (e.g., timer ticks) to interrupt the keyboard
  74.    ISR.
  75.  
  76.    Provided the interrupting timer tick ISR executes quickly, and control
  77.    returns to the keyboard handler before the scan code is replaced by
  78.    a new one, no harm is done. However, TSRs (such as REDIR) often hook
  79.    into the timer (08H) interrupt and may prolong its service time by
  80.    a substantial amount. If two scan codes come in quick succession
  81.    (as with the enhanced keys, which send E0 followed by the keycode),
  82.    then the first one (the E0 in this case) may be overwritten by the
  83.    second and be lost. Thus, the next scan code is interpreted as
  84.    a non-enhanced keystroke (a shift key or a numeric key).
  85.  
  86.    This problem would never occur if the BIOS would inhibit the keyboard
  87.    BEFORE it reenables interrupts. Unfortunately it doesn't, and the
  88.    BIOS cannot be changed.
  89.  
  90.    Three solutions to this problem have been written. The first, and the
  91.    preferable one, is KBFIX.EXE. It should be run in AUTOEXEC.BAT
  92.    before any TSRs which hook INT 9 are loaded. It searches through
  93.    the MS-DOS INT 9 handler for DOS's hook into the BIOS keyboard handler.
  94.    When it is found, the hook is modified to point just AFTER the
  95.    offending STI instruction, thereby eliminating the possibility
  96.    of interrupt preemption until after the keyboard is disabled.
  97.    Unfortunately, it is necessary for a program of this nature to
  98.    take advantage of specific characteristics of DOS and BIOS. It has
  99.    been tried successfully on several 386 and 286 AT-BIOS implementations
  100.    with no problems. The program is smart enough NOT to make the
  101.    modification if a discrepancy is noted. Since the modification
  102.    is made within DOS, the program does not need to TSR, and no additional
  103.    memory is consumed.
  104.  
  105.    If KBFIX.EXE cannot be used because INT9 is already hooked by a device
  106.    driver in CONFIG.SYS or the MSDOS is not compatible, the same effect
  107.    can be achieved by including KBDFIX.SYS as a device driver (ahead of
  108.    any other device drivers which hook INT 9) in CONFIG.SYS. The patch
  109.    will be applied directly to the BIOS INT 9 hook, and the driver
  110.    will not remain resident (no memory will be consumed).
  111.  
  112.    For specific BIOS implementations where KBFIX.EXE and KBDFIX.SYS will
  113.    not work, the INT9FIX.EXE utility was written. It loads as a TSR (288
  114.    resident bytes) and hooks the keyboard (09h) interrupt. Before passing
  115.    control to the BIOS keyboard handler, it masks IRQ0 (the timer) so the
  116.    keyboard ISR cannot be interrupted. When BIOS returns, it restores the
  117.    interrupt mask for IRQ0 to its original state. INT9FIX should normally 
  118.    be the FIRST TSR loaded which hooks INT9, so that timer interrupts are
  119.    masked for as short a time as possible. No ill effects from using this
  120.    program have yet been noted, but since timer ticks are disabled,
  121.    operation of the Print-Screen key, the INT15 scan-code translation
  122.    hook, etc., may be affected in some software configurations.
  123.    
  124.     End  KBFIX.DOC
  125.  
  126.  
  127. -- 
  128. Richard J. Hoffmann              Internet: rjhoffma@iastate.edu
  129. Department of Zoology & Genetics   Bitnet: rjhoffma%iastate.edu@isumvs
  130. Iowa State University               Voice: (515) 294-8075
  131. Ames, Iowa 50011
  132.