I'll summarize breifly what I think happens and what I can't figure out. I
was wrong about the call_method() name. I was recalling from memory the
first time. It's call_prom() and call_method_1() in prom.c in yaboot.
Before those routines get called, yaboot_start is called from crt0.S. Then
prom_init( r5 ) is called. I assume r5 means register 5? I couldn't figure
out how r5 gets set before yaboot runs but would be interested to know
just out of curiousity if anyone knows. Once prom_init starts, it calls
call_prom( "finddevice", 1, 1, "/chosen" );
All of this is fine and dandy up to the line in call_prom:
prom ( &prom_args );
Which is the miracle of the whole thing. prom being set to r5 now is
called and actually returns something from OF!
The confusing part here is that I can not find any reference to the string
"finddevice" in OF. (There is a "find-device" word.) Other things sent
to call_prom include "find-package", "getprop", etc. I guessed at
"setprop" and that works. To make matters worse, call_method_1 is itself
identical to call_prop( "call-method", ... ) "call-method" is not defined
in OF either.
call_prom("interpret", 1, 1, char *forth ) is interesting in that it will
interpret raw forth. This is how I got the mouse to work. However, I can
not find any example in yaboot where forth words are sent to call_prom().
So it seems call_prom is not the right call to use.
call_method_1() does infact get passed OF words like "load" and
"block-size". So the whole syntax for that appears to be the same as:
call_prom( "call-method", prom_handle, "load", prom_handle, nargs, ... );
I suspect I need to do something like:
call_prom( "call-method", multiboot_handle, "get-mouse_event", 3, &x, &y
&mouse );
So these would be the questions:
1) Does anyone know what other strings can be sent to call_prom besides
"getprop", "findpackage", "interpret"?
2) Are those strings words within OF that can been looked at with see?
3) Can a phandle
Nonetheless, without having a better correlation between the strings
("getprop", "setprop", "findpackage", "interpret") and what those strings
do( and what other valid strings can be used ) it will be hard to receive
feedback from the mouse.
Jeff
jcarr@linuxppc.org
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
I'll summarize breifly what I think happens and what I can't figure out. I
was wrong about the call_method() name. I was recalling from memory the
first time. It's call_prom() and call_method_1() in prom.c in yaboot.
Before those routines get called, yaboot_start is called from crt0.S. Then
prom_init( r5 ) is called. I assume r5 means register 5? I couldn't figure
out how r5 gets set before yaboot runs but would be interested to know
just out of curiousity if anyone knows. Once prom_init starts, it calls
r5 is passed as a parameter by Open FIrmware when entering crt0.S, it's a
pointer to the OF callback mecanism.
The confusing part here is that I can not find any reference to the string
"finddevice" in OF. (There is a "find-device" word.) Other things sent
to call_prom include "find-package", "getprop", etc. I guessed at
"setprop" and that works. To make matters worse, call_method_1 is itself
identical to call_prop( "call-method", ... ) "call-method" is not defined
in OF either.
Those are OF client interface calls. They are not documented in the
"user" side of OF, they are calls used by client programs (like yaboot)
to talk with OF.
call_prom("interpret", 1, 1, char *forth ) is interesting in that it will
interpret raw forth. This is how I got the mouse to work. However, I can
not find any example in yaboot where forth words are sent to call_prom().
So it seems call_prom is not the right call to use.
call_method_1() does infact get passed OF words like "load" and
"block-size". So the whole syntax for that appears to be the same as:
Yup. call_method use OF client interface call "call-method" to have OF
call a method of a given package. The package method are usually
implemented in forth.
call_prom( "call-method", prom_handle, "load", prom_handle, nargs, ... );
I suspect I need to do something like:
call_prom( "call-method", multiboot_handle, "get-mouse_event", 3, &x, &y
&mouse );
You may need to open the multiboot package before that. Also, I'm not
sure it's safe to use the multiboot private methods this way. I'd rather
decrypt what multiboot "get-mouse_event" does and reproduce that
behaviour (probably by calling either the USB HID package or the ADB package).
So these would be the questions:
1) Does anyone know what other strings can be sent to call_prom besides
"getprop", "findpackage", "interpret"?
claim, release, ... well, those are defined in the OF client interface
spec of the OF standard. Firmorks has, I think, a separate book for them
2) Are those strings words within OF that can been looked at with see?
No, well, AFAIK...
3) Can a phandle
but ?
Nonetheless, without having a better correlation between the strings
("getprop", "setprop", "findpackage", "interpret") and what those strings
do( and what other valid strings can be used ) it will be hard to receive
feedback from the mouse.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On Mon, 9 Oct 2000 jcarr@linuxppc.org wrote:
1) Does anyone know what other strings can be sent to call_prom besides
"getprop", "findpackage", "interpret"?
If you go to /openprom/client-interface or something like this (I'm away
from my OF machines at the moment), you can list these commands with
words. These are the methods of this package.
2) Are those strings words within OF that can been looked at with see?
AFAIR yes, but they won't tell you much. Very often they are short
wrappers around a known Forth word only playing with the stack to modify
the order of parameters and change the format of strings.
3) Can a phandle
Nonetheless, without having a better correlation between the strings
("getprop", "setprop", "findpackage", "interpret") and what those strings
do( and what other valid strings can be used ) it will be hard to receive
feedback from the mouse.
Well, let me know if you want more info, but actually it's quite simple.
Gabriel.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On Mon, 9 Oct 2000 jcarr@mail.linuxppc.org wrote:
quoted
quoted
1) Does anyone know what other strings can be sent to call_prom besides
"getprop", "findpackage", "interpret"?
claim, release, ... well, those are defined in the OF client interface
spec of the OF standard. Firmorks has, I think, a separate book for them
Ah ha! That explains it - that's the one firmworks manual I don't have.
Hmm, I found a description in a ps file I downloaded a few days ago when
surfing somewhere between Apple, Firmworks and Sun. Look for 1275.ps or
12750d12.ps in an FTP directory, quite a lot of functons of the client
interface are defined.
BTW: the name of the package is /openprom/client-services.
Gabriel
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Thanks. that's quite a doc. It'll take a while to grok.
Jeff
jcarr@linuxppc.org
On Tue, 10 Oct 2000, Gabriel Paubert wrote:
On Mon, 9 Oct 2000 jcarr@mail.linuxppc.org wrote:
quoted
quoted
quoted
1) Does anyone know what other strings can be sent to call_prom besides
"getprop", "findpackage", "interpret"?
claim, release, ... well, those are defined in the OF client interface
spec of the OF standard. Firmorks has, I think, a separate book for them
Ah ha! That explains it - that's the one firmworks manual I don't have.
Hmm, I found a description in a ps file I downloaded a few days ago when
surfing somewhere between Apple, Firmworks and Sun. Look for 1275.ps or
12750d12.ps in an FTP directory, quite a lot of functons of the client
interface are defined.
BTW: the name of the package is /openprom/client-services.
Gabriel
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/