Open Firmware Quick Reference

Command names can include punctuation characters,
so all commands must be separated by spaces.

Commands are executed left-to-right after a carriage-return
is typed.

Hex numbers are pushed onto a stack.

A stack diagram such as (n1 n2 -- n3) or (adr
len --) or (--) shows a command's stack effect. Items before the -- must
be present on the stack before the command executes; the command uses them
and removes them from the stack. Items after the -- are results that the
commands leaves on the stack for use by subsequent commands.

If no stack diagram is shown, the command does
not take any arguments from or leave any results on the stack.

A device specifier is a text string that identifies a node in the device
tree. It may include optional arguments to use when opening that node.

The general form of a full pathname is:
/ component / component / ...

The general form of a component is:name @ address : arguments

name matches a device node's "name" property.

address is the physical address, within the address space of
the node's parent, that matches the text representation of a device node's
"reg" property.

arguments are optional arguments that are passed to the node's
package when it is opened. arguments cannot contain space, slash
(/), or at-sign (@) characters.

Example:
/pci/scsi@7/disk@3:2,\boot\vmlinux.gz

This device specifier selects the PCI bus, then a SCSI host adapter at
PCI device number 7, then a disk at SCSI target number 3. The argument that
is passed to that disk driver selects partition number 2, then a file named
vmlinux.gz in a subdirectory named "/boot". Note the use of backslash (\)
instead of slash (/) in the argument string, because of the restriction against
using (/) in an argument.

If intermediate node names are omitted in a pathname, Open Firmware will
do its best to locate the node anyway. Thus, in many cases, an abbreviated
form of the above path would work, e.g.: /disk@3:2,\boot\vmlinux.gz

If there is no leading slash (/) and the first component is a device
alias, the alias is replaced by its expansion, repetitively if necessary.

Enter the NVRAMRC editor. If data remains in the temporary
buffer from a previous nvedit session, resume editing those previous
contents. If not, read the contents of NVRAMRC into the temporary buffer
and begin editing it.

nvalias alias device-path

Store the command "devalias alias device-path" in NVRAMRC.
(The alias persists until the nvunalias or set-defaults commands are
executed.)

Interrupt what the firmware is doing. The method for sending
a line break differs between different terminal emulator programs. For
minicom it is ALT-F or CTRL-A F. Most Windows terminal emulators have
a menu selection for sending a line break.

i

(Lower case ‘i’, typed on the serial console very early
in the startup sequence). Interrupt the early startup sequence, for debugging
purposes.

Implementation-dependent
PC keyboard chords.
These chords only work when the PC keyboard is directly connected to
the Open Firmware system.

Ctrl-Break

(For a directly-connected PC-style keyboard) Interrupt
what the firmware is doing.

Fn

(Function keys on a PC-style keyboard). Various function
keys perform emergency functions such as resetting the NVRAM to its default
values and interrupting the early startup sequence. The specific assignments
vary from implementation to implementation.

These generic register commands, and the processor-specific
ones in later sections, access the register values in the saved-program-state
area, not the instantaneous current values of the hardware registers. Changes
to the saved values take effect when the interrupted program is restarted.

.fregisters

( -- )

Display the saved values of the floating point registers.

.registers

( -- )

Display the saved values of the general registers and selected
special registers.

ctrace

( -- )

Display the return stack showing C subroutines.

set-pc

( value -- )

Set %pc to the given value, and set %npc to (value+4).

to regname

( value -- )

Change the saved value of a register. Use in the form:
value to regname.

A numeric stack is used for all numeric parameters. Typing any integer
puts that value on top of the stack. (Previous values are “pushed” down.)
The right-hand item in a set always indicates the topmost stack item.

These keystrokes control the Forth debugger when it is active (see
debug above). As you step through a Forth definition, the debugger
displays the word that is about to execute and the current stack contents.

Key

Action

<space>

Execute displayed word

D

Down: Step down into displayed word

U

Up: Finish current definition and step in its caller

C

Continue: trace current definition without stopping

F

Forth: enter a subordinate Forth interpreter

G

Go: resume normal execution (stop debugging)

H

Help: display this message

?

Display short list of debug commands

R

RSTrace: Show contents of Forth return stack

S

See: Decompile definition being debugged

$

Display top of stack as adr,len text string

Q

Quit: abandon execution of the debugged word

(

Restrict debugger to the part of the definition after
and including the word to be executed next.
This is useful for debugging words with loops in then.

<

Restrict debugger to the part of the definition
after the word to be executed next.

)

Restrict to debugger to the part of the definition
before the word to be executed next.