* Re: call_prom & call_method_1
[not found] <14776.4770.532985.35715@argo.linuxcare.com.au>
@ 2000-10-09 18:42 ` jcarr
2000-10-09 20:29 ` Benjamin Herrenschmidt
2000-10-10 0:06 ` Gabriel Paubert
0 siblings, 2 replies; 6+ messages in thread
From: jcarr @ 2000-10-09 18:42 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Benjamin Herrenschmidt, linuxppc-dev
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: call_prom & call_method_1
2000-10-09 18:42 ` call_prom & call_method_1 jcarr
@ 2000-10-09 20:29 ` Benjamin Herrenschmidt
2000-10-09 22:00 ` jcarr
2000-10-10 0:06 ` Gabriel Paubert
1 sibling, 1 reply; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2000-10-09 20:29 UTC (permalink / raw)
To: jcarr, linuxppc-dev
>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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: call_prom & call_method_1
2000-10-09 20:29 ` Benjamin Herrenschmidt
@ 2000-10-09 22:00 ` jcarr
2000-10-10 0:24 ` Gabriel Paubert
0 siblings, 1 reply; 6+ messages in thread
From: jcarr @ 2000-10-09 22:00 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
> >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.
Jeff
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: call_prom & call_method_1
2000-10-09 18:42 ` call_prom & call_method_1 jcarr
2000-10-09 20:29 ` Benjamin Herrenschmidt
@ 2000-10-10 0:06 ` Gabriel Paubert
1 sibling, 0 replies; 6+ messages in thread
From: Gabriel Paubert @ 2000-10-10 0:06 UTC (permalink / raw)
To: jcarr; +Cc: Paul Mackerras, Benjamin Herrenschmidt, linuxppc-dev
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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: call_prom & call_method_1
2000-10-09 22:00 ` jcarr
@ 2000-10-10 0:24 ` Gabriel Paubert
2000-10-10 3:17 ` jcarr
0 siblings, 1 reply; 6+ messages in thread
From: Gabriel Paubert @ 2000-10-10 0:24 UTC (permalink / raw)
To: jcarr; +Cc: Benjamin Herrenschmidt, linuxppc-dev
On Mon, 9 Oct 2000 jcarr@mail.linuxppc.org wrote:
>
> > >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/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: call_prom & call_method_1
2000-10-10 0:24 ` Gabriel Paubert
@ 2000-10-10 3:17 ` jcarr
0 siblings, 0 replies; 6+ messages in thread
From: jcarr @ 2000-10-10 3:17 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: Benjamin Herrenschmidt, linuxppc-dev
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:
>
> >
> > > >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/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2000-10-10 3:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <14776.4770.532985.35715@argo.linuxcare.com.au>
2000-10-09 18:42 ` call_prom & call_method_1 jcarr
2000-10-09 20:29 ` Benjamin Herrenschmidt
2000-10-09 22:00 ` jcarr
2000-10-10 0:24 ` Gabriel Paubert
2000-10-10 3:17 ` jcarr
2000-10-10 0:06 ` Gabriel Paubert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox