Subject: Re: machdep.c and OF 3 keyboard handling
To: None <port-macppc@netbsd.org>
From: Derek Peschel <dpeschel@eskimo.com>
List: port-macppc
Date: 12/07/2001 06:41:37
On Wed, Nov 28, 2001 at 01:16:51AM -0800, Derek Peschel wrote:
> On Tue, Nov 27, 2001 at 02:30:48PM -0500, gabriel rosenkoetter wrote:
> > On Fri, 2 Nov 2001 17:37:19 -0800, Derek Peschel wrote:

> > > * Can 1.86 be made to work with both method names?  Would it have to get
> > >   the OF version, or is there a way to ask OF directly if a method exists?
> > >   Note, ' is not what I had in mind since it prints an error if the method
> > >   doesn't exist.  I already see one error from OF (because of the call to
> > >   `usb-kbd-ihandle) and I would rather not see more.

> > A clean way to retrieve the OF version that works on all OF versions
> > would make a *lot* of our "works with this OF, not with this other"
> > issues go away. I don't think there is one. I find more and more

Though I haven't looked for the detailed BootROM version (more detailed
than "OpenFirmware 3") I did discover a way to see if a method exists.
It's FIND, and it takes a counted address (basically, pointer to string
and length of string).  I believe it returns:

	0 and some other value (I forget what) if the method
	doesn't exist

	1 and the method address if the method exists
	and is not immediate

	-1 and the method address if the method exists
	and is immediate

Unfortunately trying it with literal strings, as in

" words" find

never gave me any useful results.  I never used FORTH seriously, I only
played with various versions, and they were all pre-ANSI.  Any FORTH
people out there?

I also found a list of command editing keys.  Thank you IEEE and Apple!
See the message which I will post next.

-- Derek