Thursday, March 28, 2013

Navigating the PROM Hardware Tree

For versions 2.x and higher (SparcStation 2 and newer), the OpenBoot firmware provides for two command line interfaces:
  1. Restricted Monitor: This interface is signalled by the > prompt. It provides for execution of the b (boot), c (continue), and n (new command mode) commands. The Restricted Monitor is used to implement PROM security via the security-mode PROM environment variable.
  2. PROM Monitor: (Also known as the "Forth Monitor" or the "New Monitor.") This interface provides additional control, including a Forth command interpreter. The PROM Monitor is signalled by the ok> prompt.

Once in the ok> PROM monitor mode, it is possible to examine the tree of hardware devices known by the system. The following are the crucial commands to remember:

  • cd changes location in the device tree
  • ls lists the contents of the present node
  • pwd gives the current location in the device tree
  • dev device_pathname selects a particular node of the tree for examination.
  • .properties shows the properties for a particular node.
  • device-end unselects a node.

The device names are cryptic, but are closely related to the names of devices in the Operating System's /devices directory. The /etc/driver_aliases file may also be useful when trying to identify a device.

A full device path node name has the following form:


One example of such a name represents the 0 slice of a sun4m boot disk:


The following commands may come in handy when trying to identify the location of a device:

ok> probe-scsi-all
ok> probe-sbus
ok> show-sbus
ok> show-disks
ok> show-tapes
ok> show-nets
ok> show-devs

The ability to navigate the device tree on such a primitive level is useful for troubleshooting. If the device in question is not present, we have a physical connectivity issue. At that point, we might try a reset or power cycle, then check cables and terminators, then examine the device itself.

If the device shows up on the PROM hardware tree but not in the Operating System, we would try a boot -r, examine the /dev and /devices directories, and look at the relevant driver files.

No comments: