The Open Firmware Wiki

This blog was originally posted by z970mp on MacRumors.com. I am just adding additional information about his research. Link to the original blog: https://forums.macrumors.com/threads/the-open-firmware-wiki.2225024/

Open Firmware is a boot environment developed using the Forth programming language. Open Firmware exists to provide a machine independent means of loading operating systems, from a variety of boot devices. Open Firmware probes the PCI bus for devices and possible Open Firmware device drivers for those devices. These drivers can either be integrated into the Open Firmware or provided on an external device, thus providing plug and play capabilities for new boot devices. Open Firmware is then capable of using these drivers to load an operating system from the device.

Apple's Open Firmware is part of their ROM-in-RAM design approach originally used in the first iMac systems. The approach uses a small ROM that contains sufficient code to initialize the hardware and load an operating system. The rest of the system code, that on previous Mac systems (old world) resided on a physical ROM (chip) is now loaded from disk or from network into RAM. Open Firmware is part of this "New World" boot system.

On the latest revision of Apple systems Open Firmware provides a variety of functions. One of the key functions of Open Firmware is to configure the UniNorth and Keylargo ICs, to construct a device tree, probe devices, include any device drivers and finally select a boot device.

-

The boot process starts with the PowerPC processor executing its reset vector as specified by the Hardware Initialization code. The boot ROM stored in NVRAM provides power on self test (POST - diagnostics), and initializes enough of the system to load Open Firmware. These POST tests are run in native PowerPC code and involve checksum testing, memory testing, detection of the manufacturing test pin and test manager support. With the new family of iMac systems, additional pre-firmware diagnostics are performed due to the addition of the UniNorth and KeyLargo ICs. When enough initialization has occurred to execute Open Firmware, the boot chime is played and Open Firmware is loaded.

Open Firmware will then probe the system's I/O buses to determine the device configuration and build a device tree, which describes the hardware it has located. The system will then examine the values of its environment variables. If the auto-boot? variable is flagged as true, the system will then read the value contained within the boot-device variable and attempt to boot from that device. If additional information is required the boot-file variable is read. If the auto-boot? variable is flagged as false, the system will halt the boot process and drop to the Open Firmware user interface.

The default boot device on Apple systems is
"hd:,\\:tbxi". The system will automatically convert "hd" into the appropriate device path, as hd is simply an alias. The notation "" tells the system to start searching for "blessed" folders (directories) starting on the first HFS or HFS+ partition found on the system. The final part, "tbxi", tells the system to look for files of type tbxi. All versions of MacOS have a folder known as System Folder that is "blessed", and contains a MacOS Boot ROM file which is of type tbxi. The Boot ROM file is simply a stripped ELF executable image wrapped with a forth boot script. A "blessed" folder is simply one with a special attribute (or flag) set on it. The system will search all HFS partitions for a blessed folder and a file of type tbxi within it, if none are located, the boot will fail. The system will always select the first one found, unless the boot-device is modified to a specific partition id.

Source: http://macos9lives.com/smforum/index.php?topic=1965.0

Open Firmware Version History:

1.0.5 - Power Macintosh 7200, 7300, 7500, 7600, 8500, 8600, 9500, 9600
2.0 - Power Macintosh 6400
2.0.1 - PowerBook 3400, G3 Kanga, G3 Wallstreet, Power Macintosh G3 Beige
3.x- iMac G3 Tray Loaders, PowerBook G3 Lombard, Power Macintosh G3 B&W
4.1.7 - iBook G3 (Clamshell)
4.1.9 - Power Mac G4 (AGP Graphics)
4.4.8 - Power Mac G4 (Mirror Drive Doors, June 2003)
4.8.6 - PowerBook G4 (April 2004)
4.8.9 - Mac Mini G4 (January 2005)
4.9.1 - PowerBook G4 (January 2005)
4.9.3 - iBook G4 (July 2005)
5.1.5 - Power Mac G5 (Omega, June 2003)
5.2.7 - Power Mac G5 (Cypher, October 2005)

Open Firmware versions 1.x-2.x are incapable of directly booting into OS X via the command line as OF was mainly designed at the time to simply probe PCI devices, then load the Macintosh Toolbox ROM. These Macs would have to be manually patched by the Startup Disk program to boot Mac OS X or other XCOFF executable files.

OF 3.x onwards on the other hand can boot regularly using the regular hd:,\\:tbxi or cd:,\\:tbxi commands.

Accessing Open Firmware

Method I: At the chime, hold down the Option key. The Boot Picker comes up. Press Control + Z to switch to Open Firmware.

Method II: At the chime, hold down Command + Option + O + F until you've arrived at the Open Firmware prompt.

Method III: At the chime, press the programmers button on your Mac (if you have one) until the Open Firmware prompt appears.

Running System Diagnostics

o To reset the system NVRAM, enter reset-nvram

o To reset all changes made to Open Firmware, enter set-defaults

o To reset the machine, enter reset-all

o To display a list of all central device aliases, enter devalias

o To display information for a device, enter dev <device alias> .properties

( i.e. dev /cpus .properties | dev screen .properties | dev /memory .properties etc. )

( Note: The capacity values output by dev /memory .properties are saved in the hexadecimal format and will need to be converted to be understood by most. )

o To display a list of all utilities, enter printenv

( WARNING, DO NOT RUN setenv little-endian? true ! This will brick your machine beyond trivial repair! )

o To check for available bootable operating systems, enter multi-boot into the prompt. The Boot Picker comes up. For OF 3.x devices, it will only show bootable devices from the command line as the GUI for boot picker wasn’t implemented yet. This doesn’t apply to Lombard PowerBook G3s. This does not work on OF 1.x or 2.x devices.

Note: The utility's interface and control methods may vary between versions.

o To check the system hard disk and its partitions without extracting it from the machine, enter target-mode into the prompt. Target Disk Mode comes up. Connect a FireWire cable from the subject machine to another compatible machine. The subject machine's partitions will appear on the other machine, ready for review or remote boot.

Booting an Operating System

o To automatically enter Open Firmware upon boot, enter setenv auto-boot? false

( Enter setenv auto-boot? true to revert to default. )

o To set a default boot volume, enter setenv boot-device <volume>:<partition ID>,<path>

( i.e. setenv boot-device hd:1,\\:tbxi | setenv boot-device cd:,\\yaboot | setenv boot-device ud:,ofwboot | etc. )

( If no partition ID is provided, the system will look for the first available OS on the specified volume. If none are found, the system will either revert back to Open Firmware, or display a "do not cross" symbol. )

o To boot between locally installed operating systems, enter multi-boot into the prompt. The Boot Picker comes up.

Note: The utility's interface and control methods may vary between versions.

o To boot from a USB disk, enter one of the following depending on the targeted OS (OF V. 4.9 / 5.2 Only) -

Mac OS X: boot ud:,\\:tbxi

Linux: boot ud:,\\yaboot

Linux (GRUB): boot ud:,\\grub.img

OpenBSD: boot ud:,ofwboot


Tricks

o To initialize The Boot Picker faster, enter setenv skip-netboot? true. This will disable scanning for a bootable network OS. To turn NetBoot back on, enter setenv skip-netboot? false.

o To set up a personalized welcome message for Open Firmware to repeat upon activation, enter setenv oem-banner < enter a custom message here > , and setenv oem-banner? true .


Actions

mac-boot: boots either the specified default or first available operating system environment

shut-down: saves all changes and turns off the machine

eject cd: ejects the disc tray or loaded optical disc

bye: executes the default boot-command


[ Build Resources ]


Resource 1:
http://web.archive.org/web/20200529...ook/bonus/ancient/whatismacosx/arch_boot.html

Resource 2: http://www.firmworks.com/QuickRef.html

Previous
Previous

iPhone OS 1.0 Boot Screens

Next
Next

2006 iMac with hidden EFI menu