You can browse the device tree to examine and modify individual device tree nodes. The device tree browsing commands are similar to the UNIX\256 commands for changing the working directory within the UNIX directory tree. Selecting a device node makes it the current node.
Examine the device tree with the commands shown in the following table.
Table 1-4 Commands for Browsing the Device Tree
Command |
Description |
---|---|
.attributes |
Display the names and values of the current node's properties. |
cd device-path |
Select the indicated device node, making it the current node. |
cd node-name |
Search for a node with the given name in the subtree below the current node, and select the first such node found. |
cd .. |
Select the device node that is the parent of the current node. |
cd / |
Select the root machine node. |
device-end |
De-select the current device node, leaving no node selected. |
ls |
Display the names of the current node's children. |
pwd |
Display the device path name that names the current node. |
show-devs [device-path] |
Display all the devices known to the system directly beneath a given level in the device hierarchy. show-devs used by itself shows the entire device tree. |
words |
Display the names of the current node's methods. |
If you have been browsing the device tree, and want to reset the system, type:
ok device-end ok reset
The following example shows the use of .attributes:
ok cd /zs@1,f0000000 ok .attributes 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
show-devs lists all the devices in the OpenBoot device tree, as shown in the following example:
ok show-devs /fd@1,f7200000 /virtual-memory@0,0 /memory@0,0 /sbus@1,f8000000 /auxiliary-io@1,f7400003 /interrupt-enable@1,f5000000 /memory-error@1,f4000000 /counter-timer@1,f3000000 /eeprom@1,f2000000 /audio@1,f7201000 /zs@1,f0000000 /zs@1,f1000000 /openprom /aliases /options /packages /sbus@1,f8000000/cgsix@3,0 /sbus@1,f8000000/le@0,c00000 /sbus@1,f8000000/esp@0,800000 ok
The following is an example of the use of words:
ok cd /zs ok words selftest ring-bell read remove-abort? install-abort close open abort? restore clear reset initkbdmouse keyboard-addr mouse 1200baud setbaud initport port-addr ok