The device tree is a data structure that the Macintosh startup firmware creates in system RAM to provide information about configured devices to other software, including firmware on PCI cards. Attached to it are the drivers and support software that devices need to operate. The device tree in PCI-compatible Power Macintosh computers is similar to the sResource table previously used in NuBus-compatible Macintosh computers. For further information, see Startup Firmware.
The device tree is the structure from which Mac OS extracts the original information to create the device portion of the Name Registry. A device tree entry may be a device node (a entry that serves one hardware device) or a property entry (a list of name-and-value pairs associated with a device entry). Device nodes may have child device nodes, creating a branching tree structure; however, the tree begins with a single root entry. Device nodes in the single systemwide device tree may serve devices that are connected to the PowerPC processor bus through different bridges. Each device entry in the tree has one or more property nodes. An important use of property nodes is to store drivers associated with PCI card devices.
You can view the Name Registry generally as a global tree structure with a large branch equal to the original Open Firmware device tree plus and minus a few properties. When bringing the Open Firmware device tree to Mac OS through the Open Firmware client interface, the only pruning of the original tree is to delete drivers for other operating systems that may be stored there. All drivers with a driver,AAPL,MacOS,PowerPC property are brought into the Mac OS Name Registry.
The device tree for a pre-NewWorld PCI-based Power Macintosh computer (the Power Macintosh 9500) is shown in Listing 10-1. Note that the Bandit and Hammerhead ASICs are also shown in Figure 10-2. Listing X shows the device tree for a Power Macintosh G3 Pro.
Listing 10-1 A typical device tree
/bandit@F2000000
/gc@10
/53c94@10000
/sd@0,0
/mace@11000
/escc@13020
/escc@13000
/awacs@14000
/swim3@15000
/via-cuda@16000
/adb@0,0
/keyboard@0,0
/mouse@1,0
/pram@0,0
/rtc@0,0
/power-mgt@0,0
/mesh@18000
/sd@0,0
/bandit@B
/AAPL,8250@E
/bandit@F4000000
/bandit@B
/ATY,mach64@E
/hammerhead@F8000000