(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) PowerPC Linux : (Category) LinuxPPC for PCI Macs : (Category) Installation :
Open Firmware.
Open Firmware (OF) is software which is present in the ROM of all
Power Macintoshes which include a PCI bus (which includes all Power
Macs manufactured in at least the last two years or so).  OF has two
main functions:

(1) It builds a data structure called the device tree which describes
all the I/O devices and buses in the system and how they are
interconnected.

(2) It boots an operating system from some specified device.

In addition, OF has a user interface which you can use to inspect the
device tree, inspect and change OF's settings, or boot.  In fact the
user interface is a complete forth interpreter, which means that if
you know Forth, you can do some quite powerful things.

OF maintains a set of variables in non-volatile RAM which control its
behaviour.  These variables can be inspected and changed under MacOS
using the Boot Variables application, under Linux using the nvsetenv
command, or with the OF user interface.  These variables include:

boot-device     The OF name of the device to boot from.
boot-file       Extra arguments to pass to the operating system.
auto-boot?      Controls whether OF automatically boots, or
                invokes the user interface on startup.
input-device    Input device for the user interface.
output-device   Output device for the user interface.

OF obtains control early in the boot process after power-on self tests
have been run.  It scans the buses in the system and builds the device
tree.  Normally it then boots an operating system from the selected
boot device (specified by the value of the `boot-device' variable).
On most Power Macs this is set to `/AAPL,ROM', which causes OF to
transfer control to MacOS in ROM.  By changing this to some other
value, we can get OF to boot Linux instead of MacOS.  Some example
values are:

fd:installer.coff       Floppy disk (specifically, the file
                        `installer.coff' on the floppy disk)
scsi/sd@1:0             SCSI disk at ID 1
scsi-int/sd@0:0         SCSI disk at ID 0 on the internal SCSI bus
ata/ata-disk@0:0        Internal IDE disk

Here `scsi', `scsi-int', and `ata' are examples of aliases - names
which stand for a full OF device name.  For example, `scsi' might be
an alias for `/bandit@F2000000/gc@10/53c94@10000'.  The set of aliases
varies between systems.  You can examine the list of aliases using the
`devalias' OF command.  The Apple tech note TN1062 gives a detailed
description of OF device names, if you are interested (see the
references at the end).

Generally, on machines that have only one SCSI bus, `scsi' is an alias
for the SCSI controller.  On machines that have two SCSI buses, such
as the 7500, 8500, etc., `scsi' is an alias for the controller for the
external bus, and `scsi-int' is an alias for the internal bus
controller.  `ata/ata-disk' is an alias for the internal IDE disk on
some machines; on other machines it might be `ata/ATA-Disk'.

Usually there will be aliases for other devices, for example:

ttya                    Modem serial port
ttyb                    Printer serial port
kbd                     Keyboard
screen                  Screen display (on newer machines)
enet                    Ethernet interface

Normally the `input-device' and `output-device' variables are set by
default to `ttya', which means that you can talk to OF's user
interface by connecting a terminal or terminal emulator to the modem
port, set to 38400 baud, 1 stop bit, no parity.

Older machines, such as the 7200, 7500, 8200, 8500, etc. usually have
version 1.5.1 of Apple's Open Firmware implementation.  Newer machines
(e.g. the 7300, 6400, etc.) and most clones have version 2.0.  There
are some problems with the older version:

* It doesn't have a driver for the screen display on the 7200, 8200
and clones (e.g. the PowerCenter 150).  If you don't have a terminal
or emulator to connect to the serial port, you can still set
input-device to `kbd' so that you can issue commands to OF's user
interface, as long as you don't mind typing blind.

* It doesn't define a `screen' alias, so you have to know the OF
device name for your screen.  On the 7500 and 8500, this is
`/chaos/control' (or alternatively `vci/@B', which amounts to the same
thing).  It does have a driver for the screen display on these
machines, but the driver often doesn't initialize the screen
successfully.

* The OF variables get reset to default values every time MacOS starts
up.

Having set the input-device and output-device variables to appropriate
values for your system, there are then basically two ways of invoking
OF's user interface:

- You can set the auto-boot? variable to `false' and restart.  OF will
start up its user interface instead of booting.

- You can hold down the command, option, O and F keys.  If these keys
(and no others) are depressed at the point when OF would otherwise
boot an operating system (i.e. just after the reset chord finishes
sounding), OF will startup its user interface instead of booting.
This works even if the input-device is not set to the keyboard.

Once you are talking to OF's user interface, these are some of the
commands you can use:

boot                    boot from the device specified in boot-device
boot <device> <args>    boot from <device>, and pass <args> to the
                        booted operating system
bye                     boot MacOS
devalias                print the list of device aliases
printenv                print out the values of OF's variables
setenv <var> <value>    set variable <var> to <value>
dev device              make <device> be the current device
                        (`..' means the parent of the current device)
ls                      display descendents of the current device
properties              display the properties of the current device

Another key combination which can be useful in an emergency is
command-option-P-R.  If these keys are depressed when OF starts, it
will reset the contents of the non-volatile RAM to default values and
proceed to boot MacOS.  (Unfortunately, it is possible for bogus
settings of some of OF's variables to prevent it from starting at all.
In this case, the only resort seems to be to temporarily remove the
battery in your machine which makes the RAM nonvolatile.)

Powermac/Linux can be booted from floppy, over ethernet, or from a
SCSI or IDE hard disk.  Booting Linux from a hard disk requires that
the root partition of the linux installation have a first-stage boot
block installed, a second-stage bootstrap file and kernel image in the
root partition, and that the root partition be marked bootable in the
disk's partition map.  (Knowledgeable readers will notice that
`requires' is not strictly true, because other workable arrangements
exist, but this is the most straightforward arrangement.)  This can
all be set up automatically using the `quik' command under Linux or
the `Quik-MacOS' application under MacOS.

Booting from floppy is relatively simple: you put an XCOFF-format
kernel image on a MacOS (HFS) format high-density (1.44MB) floppy and
put the image file name in the boot device (e.g. `fd:vmlinux.coff').

Booting over ethernet requires that you set up another machine as a
BOOTP server, and arrange for it to supply the appropriate XCOFF-
format kernel image file.  The BOOTP server must be on the same subnet
as the machine being booted.  Booting over ethernet is much quicker
than booting from floppy, but unless you've done it before, setting up
a BOOTP server will probably take much longer than simply copying a
kernel image to a floppy under MacOS.
scsi/sd@1, scsi-int/sd@0, ata/ata-disk@0, `/bandit@F2000000/gc@10/53c94@10000, `vci/@B
[Append to This Answer]
Previous: (Answer) Introduction.
Next: (Answer) Partitioning.
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=176
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo