PROM Device Tree (Full Device Pathnames)Display devices connected to the bus.
Note The Device Tree Versus Device Pathname The terms device tree and device pathname are often interchanged, and you'll see both used. They both mean the same thing. OpenBoot deals directly with the hardware devices in the system. Each device has a unique name that represents both the type of device and the location of that device in the device tree. The OpenBoot firmware builds a device tree for all devices from information gathered at the POST. Sun uses the device tree to organize devices that are attached to the system. The device tree is loaded into memory, to be used by the kernel during boot to identify all configured devices. The paths built in the device tree by OpenBoot vary, depending on the type of system and its device configuration. The following example shows a full device pathname for an internal disk on a peripheral component interconnect (PCI) bus system such as an Ultra 5: /pci@1f,0/pci@1,1/ide@3/disk@0,0 Typically, the OBP uses disk and cdrom for the boot disk and CD-ROM drive. The following example shows the disk device on an Ultra system with a PCI-SCSI bus and a SCSI target address of 3: /pci@1f,0/pci@1/scsi@1,1/sd@3,0 A device tree is a series of node names separated by slashes (/). The top of the device tree is the root device node. Following the root device node, and separated by a leading slash /, is a list of bus devices and controllers. Each device pathname has this form: driver-name@unit-address:device-arguments The components of the device pathname are described in Table 3.3. You use the OpenBoot command show-devs to obtain information about the device tree and to display device pathnames. This command displays all the devices known to the system directly beneath a given device in the device hierarchy. show-devs used by itself shows the entire device tree. The syntax is as follows: ok show-devs The system outputs the entire device tree, as follows: /SUNW,UltraSPARC-IIi@0,0 /pci@1f,0 /virtual-memory /memory@0,10000000 /aliases /options /openprom /chosen /packages /pci@1f,0/pci@1 /pci@1f,0/pci@1,1 /pci@1f,0/pci@1/scsi@1,1 /pci@1f,0/pci@1/scsi@1 /pci@1f,0/pci@1/scsi@1,1/tape /pci@1f,0/pci@1/scsi@1,1/disk /pci@1f,0/pci@1/scsi@1/tape /pci@1f,0/pci@1/scsi@1/disk /pci@1f,0/pci@1,1/ide@3 /pci@1f,0/pci@1,1/SUNW,m64B@2 /pci@1f,0/pci@1,1/network@1,1 /pci@1f,0/pci@1,1/ebus@1 /pci@1f,0/pci@1,1/ide@3/cdrom /pci@1f,0/pci@1,1/ide@3/disk /pci@1f,0/pci@1,1/ebus@1/SUNW,CS4231@14,200000 /pci@1f,0/pci@1,1/ebus@1/flashprom@10,0 /pci@1f,0/pci@1,1/ebus@1/eeprom@14,0 /pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0 /pci@1f,0/pci@1,1/ebus@1/ecpp@14,3043bc /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8 /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8 /pci@1f,0/pci@1,1/ebus@1/se@14,400000 /pci@1f,0/pci@1,1/ebus@1/SUNW,pll@14,504000 /pci@1f,0/pci@1,1/ebus@1/power@14,724000 /pci@1f,0/pci@1,1/ebus@1/auxio@14,726000 /openprom/client-services /packages/ufs-file-system /packages/sun-keyboard /packages/SUNW,builtin-drivers /packages/disk-label /packages/obp-tftp /packages/deblocker /packages/terminal-emulator ok Commands that are used to examine the device tree are listed in Table 3.4.
You can examine the device path from a Unix shell prompt by typing the following: prtconf -p The system displays the following information: System Configuration: Sun Microsystems sun4u Memory size: 128 Megabytes System Peripherals (PROM Nodes): Node 'SUNW,Ultra-5_10' Node 'packages' Node 'terminal-emulator' Node 'deblocker' Node 'obp-tftp' Node 'disk-label' Node 'SUNW,builtin-drivers' Node 'sun-keyboard' Node 'ufs-file-system' Node 'chosen' Node 'openprom' Node 'client-services' Node 'options' Node 'aliases' Node 'memory' Node 'virtual-memory' Node 'pci' Node 'pci' Node 'ebus' Node 'auxio' Node 'power' Node 'SUNW,pll' Node 'se' Node 'su' Node 'su' Node 'ecpp' Node 'fdthree' Node 'eeprom' Node 'flashprom' Node 'SUNW,CS4231' Node 'network' Node 'SUNW,m64B' Node 'ide' Node 'disk' Node 'cdrom' Node 'pci' Node 'scsi' Node 'disk' Node 'tape' Node 'scsi' Node 'disk' Node 'tape' Node 'SUNW,UltraSPARC-IIi' OpenBoot Device AliasesCreate and remove custom device aliases. Device pathnames can be long and complex. Device aliases, like Unix file system aliases, allow you to substitute a short name for a long name. An alias represents an entire device pathname, not a component of it. For example, the alias disk0 might represent the following device pathname: /pci@1f,0/pci@1,1/ide@3/disk@0,0 OpenBoot provides the predefined device aliases listed in Table 3.5 for commonly used devices, so you rarely need to type a full device pathname. Be aware, however, that device aliases and pathnames can vary on each platform. The device aliases shown in Table 3.5 are from a Sun Ultra 5 system.
If you add disk drives or change the target of the startup drive, you might need to modify these device aliases. Table 3.6 describes the devalias commands, which are used to examine, create, and change OpenBoot aliases.
Note Don't Use Existing devalias Names If an alias with the same name already exists, you'll see two aliases defined: a devalias with the old value and a devalias with the new value. It gets confusing as to which devalias is the current devalias. Therefore, it is recommended that you do not reuse the name of an existing devalias, but choose a new name. The following example creates a device alias named bootdisk, which represents an Integrated Drive Electronics (IDE) disk with a target ID of 3 on an Ultra 5 system: devalias bootdisk /pci@1f,0/pci@1,1/ide@3/disk@3,0 To confirm the alias, you type devalias, as follows: ok devalias The system responds by printing all the aliases, like this: bootdisk /pci@1f,0/pci@1,1/ide@3/disk@3,0 screen /pci@1f,0/pci@1,1/SUNW,m64B@2 net /pci@1f,0/pci@1,1/network@1,1 cdrom /pci@1f,0/pci@1,1/ide@3/cdrom@2,0:f disk /pci@1f,0/pci@1,1/ide@3/disk@0,0 disk3 /pci@1f,0/pci@1,1/ide@3/disk@3,0 disk2 /pci@1f,0/pci@1,1/ide@3/disk@2,0 disk1 /pci@1f,0/pci@1,1/ide@3/disk@1,0 disk0 /pci@1f,0/pci@1,1/ide@3/disk@0,0 ide /pci@1f,0/pci@1,1/ide@3 floppy /pci@1f,0/pci@1,1/ebus@1/fdthree ttyb /pci@1f,0/pci@1,1/ebus@1/se:b ttya /pci@1f,0/pci@1,1/ebus@1/se:a keyboard! /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8:forcemode keyboard /pci@1f,0/pci@1,1/ebus@1/su@14,3083f8 mouse /pci@1f,0/pci@1,1/ebus@1/su@14,3062f8 name aliases You can also view device aliases from a shell prompt by using the prtconf -vp command. User-defined aliases are lost after a system reset or power cycle unless you create a permanent alias. If you want to create permanent aliases, you can either manually store the devalias command in a portion of NVRAM called NVRAMRC or you can use the nvalias and nvunalias commands. The following section describes how to configure permanent settings in the NVRAM on a Sun system. |