living with an "extended" keyboard

Charles Hedrick hedrick at athos.rutgers.edu
Sun Apr 3 14:34:33 AEST 1988


Someone asked how to fix things up for one of those "extended"
keyboards, that have all the keys in the wrong place.  Here's my
kernel patch file.  As you can see from the comments, I make 4
different changes to the keyboard:
  - the caps lock key now acts like a control key
  - the `~ key now acts like an esc key when unshifted.  When shifted
	it still generates ~
  - the ESC key now generates `
  - the backspace key new generates rubout.
If you don't want all of these changes, just take the ones you like.
In addition, I've got a clock value appropriate for a Leading Edge D2,
and the patch to make the clock work consistently (but at the price of
slower serial I/O).  The latter is from the Uport bboard.  Again,
remove these if you don't want them.  I use kermit at 2400 baud a lot.
The clock patch hasn't caused me any trouble.  From from the 
documentation it sounds like you shouldn't use it if you do things
like UUCP or have more serial traffic than I do.

For some reason that I don't understand, when I installed the keyboard
patches, my system suddenly had trouble booting.  Init would complain
that login had failed.  I installed the new init from the uport
bboard, and turned up the wait timeout as they suggested, and the
problem went away.  So it looks like for some reason these patches
slow down login just enough to make init timeout.  Why login should
care what the kernel's keyboard map table looks like I have no idea.
Make sure you keep a copy of the kernel as it was before you install
these changes, in case you need to back out.

# add -k before /unix to do the running kernel
# there are 4 int's per character, which seem to be shifted, normal, and
#   then presumably the same with ALT held down.  I have little idea
#   what the bits mean, though the simpler entries are just the ASCII
#   character.  For others, I just copied old entries.  Note that the
#   position in the table is the IBM keyboard scan code value.
# there is another table, kb_std_control, that presumably handles
#   things when CTL is down.  It has one byte per key, which is the
#   ASCII control char, or 0 if undefined.

# turn caps lock into control
/etc/patch /unix +0x1d0 kb_std_data 0x0104 0x0104 0x0104 0x0104
# turn ` into ESC
# patch /unix +0x148 kb_std_data 0x001b 0x001b 0x001b 0x001b
/etc/patch /unix +0x148 kb_std_data 0x001b 0x007e 0x001b 0x037e
# turn ESC into `
/etc/patch /unix +0x8   kb_std_data 0x2060 0x007e 0x0360 0x037e
# turn backsp into rubout
/etc/patch /unix +0x70  kb_std_data 0x007f 0x007f 0x007f 0x007f
# get the clock right.  This probably good to 1 sec in 4 hours
/etc/patch /unix clocktic 19878
# following patches turn up the clock priority.  The magic bit
# masks are simply the original & ~1.  See clock.pat for details
/etc/patch /unix -b +4 mastbl 0x40
/etc/patch /unix -b +5 mastbl 0xe0
/etc/patch /unix -b +6 mastbl 0xe2
/etc/patch /unix -b +7 mastbl 0xfe
/etc/patch /unix -b +0 levels 7



More information about the Comp.unix.microport mailing list