Solaris & OS X Topics

Open Firmware

Open Firmware - don't try this at home

 

A 'nice' difference between Solaris and Mac OS X with respect to Open Firmware, is that in Solaris, the Open Firmware 'device tree' is mirrored under '/devices', and the 'devices' under /dev are links to the nodes of the device tree under '/devices', which are in turn, your normal block-special or character devices, etc.

For example, the first disk on my Sun Blade 100 is c0t0d0s* (controller 0, target 0, disk 0, slice [partition] *) The /dev/dsk/c0t0d0s? entries are links to /devices

lrwxrwxrwx 1 root 38 Apr 17 2001 c0t0d0s0 -> ../../devices/pci@1f,0/ide@d/dad@0,0:a
lrwxrwxrwx 1 root 38 Apr 17 2001 c0t0d0s1 -> ../../devices/pci@1f,0/ide@d/dad@0,0:b
lrwxrwxrwx 1 root 38 Apr 17 2001 c0t0d0s2 -> ../../devices/pci@1f,0/ide@d/dad@0,0:c

(etc.) and then those entries in /devices/pci@1f,0/ide@d/ are the actual block/character special devices:

brw-r----- 1 root 136, 0 Apr 17 2001 dad@0,0:a
crw-r----- 1 root 136, 0 Apr 17 2001 dad@0,0:a,raw

So with Solaris it is very easy to figure out what the Open Firmware device node is for a given Unix device, be it a hard disk, serial port, network adapter, etc. Where as in Mac OS X, these paths to the device nodes are not presented at the file system level, under /dev the block are character devices show up directly:

brw-r----- 1 root operator 14, 9 Nov 26 17:26 disk0s9
crw-r----- 1 root operator 14, 9 Nov 26 17:26 rdisk0s9
crw-r----- 1 root operator 14, 10 Nov 26 17:26 rdisk0s10
brw-r----- 1 root operator 14, 10 Nov 26 17:26 disk0s10

where, disk 0 slice 9 is my boot device, as shown in nvram -p | grep boot-device which is displayed as either

boot-device mac-io/ata-4@1f000/@0:9,\\:tbxi
boot-device /pci@f2000000/mac-io@17/ata-4@1f000/@0:9,\\:tbxi

the latter being the full device tree path.