You can browse the device tree to examine and modify individual device tree nodes. The device tree browsing commands are similar to the SolarisTM TMcommands for changing, displaying and listing the current directory in the Solaris directory tree. Selecting a device node makes it the current node.
The User Interface commands for browsing the device tree are shown in Table 1-3.
Table 1-3 Commands for Browsing the Device Tree
Command |
Description |
---|---|
.properties |
Display the names and values of the current node's properties. |
dev device-path |
Choose the indicated device node, making it the current node. |
dev node-name |
Search for a node with the given name in the subtree below the current node, and choose the first such node found. |
dev .. |
Choose the device node that is the parent of the current node. |
dev / |
Choose the root machine node. |
device-end |
Leave the device tree. |
" device-path" find-device |
Choose device node, similar to dev. |
ls |
Display the names of the current node's children. |
pwd |
Display the device path name that names the current node. |
see wordname |
Decompile the specified word. |
show-devs [device-path] |
Display all the devices directly beneath the specified device in the device tree. show-devs used by itself shows the entire device tree. |
words |
Display the names of the current node's methods. |
" device-path" select-dev |
Select the specified device and make it the active node. |
.properties displays the names and values of all the properties in the current node:
ok dev /zs@1,f0000000 ok .properties address ffee9000 port-b-ignore-cd port-a-ignore-cd keyboard device_type serial slave 00000001 intr 0000000c 00000000 interrupts 0000000c reg 00000001 f0000000 00000008 name zs ok
dev sets the current node to the named node so its contents can be viewed. For example, to make the ACME company's SBus device named "ACME,widget" the current node:
ok dev /sbus/ACME,widget
find-device is essentially identical to dev differing only in the way the input pathname is passed.
ok " /sbus/ACME,widget" find-device
After choosing a device node with dev or find-device, you can't execute that node's methods because dev does not establish the current instance. For a detailed explanation of this issue, refer toWriting FCode 3.x Programs.
show-devs lists all the devices in the OpenBoot device tree, as shown in the following example:
ok show-devs /SUNW,UltraSPARC@0,0 /sbus@1f,0 /counter-timer@1f,3c00 /virtual-memory /memory@0,0 /aliases /options /openprom /chosen /packages /sbus@1f,0/cgsix@1,0 /sbus@1f,0/lebuffer@0,40000 /sbus@1f,0/dma@0,81000 /sbus@1f,0/SUNW,bpp@e,c800000 /sbus@1f,0/SUNW,hme@e,8c00000 /sbus@1f,0/SUNW,fas@e,8800000 /sbus@1f,0/sc@f,1300000 /sbus@1f,0/zs@f,1000000 /sbus@1f,0/zs@f,1100000 /sbus@1f,0/eeprom@f,1200000 /sbus@1f,0/SUNW,fdtwo@f,1400000 /sbus@1f,0/flashprom@f,0 /sbus@1f,0/auxio@f,1900000 /sbus@1f,0/SUNW,CS4231@d,c000000 /sbus@1f,0/SUNW,fas@e,8800000/st /sbus@1f,0/SUNW,fas@e,8800000/sd /openprom/client-services /packages/disk-label /packages/obp-tftp /packages/deblocker /packages/terminal-emulator ok
Here is an example of the use of words:
ok dev /zs ok words ring-bell read remove-abort? install-abort close open abort? restore clear reset initkbdmouse keyboard-addr mouse 1200baud setbaud initport port-addr