Subject: Re: console keyboard mapping
To: Ken Nakata <kenn@eden.rutgers.edu>
From: The Great Mr. Kurtz <davagatw@mars.utm.edu>
List: port-mac68k
Date: 04/18/1996 11:18:51
On Wed, 17 Apr 1996, Ken Nakata wrote:

> > > So, I think it's better to supply such an
> > > interface (probably an ioctl() for /dev/adb) and key map definition
> > > files for various international keyboard layouts.  And a user can
> > > install any of those as he/she wishes, or write one if there isn't any
> > > already written for his/her keyboard layout.
> >
> > But how to pass this lot information? We need 5*128 = 640 bytes to pass.
>
> It's not much.  Besides, all we need is a new ioctl function code for
> installation of keymap.  Open() the device, ioctl(fd, ADBIOCBLAH,
> &keymap), and close().  This is the basic outline of the userland
> keymap installer.  It's simple, isn't it?
>
> > Passing one information per call whould be time consuming and require a
> > configuration program or script. Passing a pointer to a buffer whould require a
> > configuration program, passing something like a file descriptor whould require
> > the the console to read the file, this is new funtionality...
>
> I don't understand what you say here.  Passing the entire keymap is
> fine because you don't switch from one map to another that often.

I'm not following this too well because drivers really aren't my thing,
but...

Doesn't the kernel already contain a keyboard mapping table?  Couldn't you
just set up a section to malloc a section of memory and copy the kernel's
internal table there and change the references throughout the kernel to
point to that new memory location, so that the only thing that must be
passed from one section of the kernel to another is a single pointer to
the new start-of-map location?  Or am I missing something fundamental
here?

Or for that matter, other programs access a "symbol table" within the
kernel to determine the locations of data that they need (ps, netstat,
etc.), right?  Just add another pointer in that table that points to the
permanent location of the keymapping within the kernel.  Then, allow a
program that runs on startup to change that section of the running copy of
the kernel.  I know, I know... it's not a good idea to change the kernel
while it's running.  Just as long as you only allow that one block to be
modified and not any of the rest....

Any thoughts on this?

 /---------------------------------------------------------------------\
|David A. Gatwood             And Richard Cory, one calm summer night,  |
|davagatw@mars              Went home and put a bullet through his head.|
|dgatwood@nyx.cs.du.edu              --Edwin Arlington Robinson         |
|http://mars.utm.edu/~davagatw -or- http://nox.cs.du.edu:8001/~dgatwood |
 \---------------------------------------------------------------------/