[SPARCbook] OpenBoot tricks (was [SunRescue] NetBSD 1.5 CDROM)

Stephen Dowdy sparcbook at sunhelp.org
Thu Jan 25 20:38:00 CST 2001


Matthew Haas <wedge at lightlink.com> wrote:

> Third little tidbit- more of a question: Has anyone played/has info on the
> PROM's "words" command? If you type "words" at the ok prompt, you get a
> list of ALL the available commands... descending into the device tree
> (especially on the SPARCbook- under the obio I believe) gives a refined
> list of "words" available at that particular device location, and I've
> seen things such as PCMCIA-related things, as well as other nifty
> goodies... anyone know the deal behind these?
> 
 
"words" shows you the current vocabulary's command list.  At the "top"
you are using the "FORTH" vocabulary.  The "cd" command basically just
changes the current vocabulary.  There's a command to list the known
vocabularies and the current vocabulary (top of the vocabulary stack), i
just forget it.  (simply typing "FORTH" basically resets everything)


A very useful FORTH word is "sifting".  "sifting" is essentially a:

	words | grep \!:1

So, to find all the commands that have "module" in them:

	OK sifting module

(i don't have a SPARCbook in front of me, so i don't know all that gets reported, but
presumably  "module-info" will be listed as well as other things).


Another very useful FORTH word is "see".  This decomposes a compiled word into its
component list of elements.

	OK see blah

	: blah
		frib-frab dup * jim-jam +
	;


If you want to play around with this more, the OBP 2.x and 3.x User References are
on 'http://docs.sun.com' somewhere.

--stephen
--
Stephen Dowdy - Systems Administrator - CS Dept - Univ of Colorado at Boulder
dowdy at cs.colorado.edu  --  http://www.cs.colorado.edu/~dowdy/signature.html



More information about the SPARCBook mailing list