NAME
boot
—
Macppc system bootstrapping
procedures
DESCRIPTION
Power fail and crash recovery
Normally, the system will reboot itself at power-up or after crashes. An automatic consistency check of the file systems will be performed as described in fsck(8), and unless this fails, the system will resume multi-user operations.
Cold starts
The boot ROM performs a Power On Self Test (POST) then loads Open
Firmware. Depending on the Open Firmware variable
‘auto-boot?
’ it will either stop at
the Open Firmware prompt or attempt to boot an operating system. Depending
on the contents of the ‘use-nvramrc?
’,
‘boot-command
’,
‘boot-device
’, and
‘boot-file
’ Open Firmware variables,
it will attempt to boot MacOS, MacOS X, or
NetBSD.
To boot NetBSD, Open Firmware loads the
bootloader
macppc/ofwboot(8) from the specified
‘boot-device
’. The bootloader then
loads the kernel from the ‘boot-file
’,
(if it exists). Otherwise, it tries to load (in the following order):
netbsd, netbsd.gz, or
netbsd.macppc on the “a” partition of
the same device that had the bootloader.
Open Firmware Commands
An essential but incomplete list of Open Firmware commands follows. A more thorough list is contained in the FAQ. http://www.NetBSD.org/ports/macppc/faq.html#ofw-use
boot
[boot-device
[boot-file]] [options]
Boot an operating system. The default arguments for this command are taken from the Open Firmware environment variables:
- boot-device
- primary bootloader location
- boot-file
- kernel location
- options
- flags passed to the kernel
reset-all
Reset the system, and proceed as specified by the
‘use-nvramrc?
’ and
‘auto-boot?
’ variables. If
‘use-nvramrc?
’ is set to
‘true
’, then the system will attempt
to execute the commands stored in the
‘nvramrc
’ variable. If
‘auto-boot?
’ is set to
‘true
’, the system will attempt to use
the values stored in ‘boot-command
’,
‘boot-device
’, and
‘boot-file
’ to boot the system. If
‘auto-boot?
’ is set to
‘false
’, the system will halt at the
Open Firmware prompt.
shut-down
Power off the system.
setenv
variable
value
Set an Open Firmware variable, e.g.,
setenv auto-boot? false setenv boot-device hd:,\ofwboot.xcf setenv boot-file netbsd-GENERIC.gz
set-default
variable
Set an Open Firmware variable to its default value.
printenv
[variable]
Show Open Firmware variables and values.
eject fd
Eject floppy disk on systems with on-board floppy drives.
mac-boot
Attempt to boot MacOS on an Open Firmware 3 system.
bye
Attempt to boot MacOS on an Open Firmware 1.0.5, 2.0.x, or 2.4 system.
Open Firmware Variables
An essential but incomplete list of Open Firmware variables follows. A more thorough list is contained in the FAQ. http://www.NetBSD.org/ports/macppc/faq.html#ofw-variables
auto-boot?
- What Open Firmware will do at system startup or reset:
- true
- automatically bootstrap an operating system using values from the
‘
boot-command
’, ‘boot-device
’, and ‘boot-file
’ variables. - false
- stop at the Open Firmware prompt.
use-nvramrc?
- If ‘
true
’ runs commands in variable ‘nvramrc
’. real-base
- Kernel memory location. Do not modify this value on Open
Firmware 3 systems — you may damage your
computer. All other Open Firmware versions should use
F00000
. load-base
- Bootloader memory location. Do not modify this value on Open
Firmware 3 systems — you may damage your
computer. All other Open Firmware versions should use
600000
. boot-command
- The command to use for booting. Typically, the default of
‘
boot
’ is used. boot-device
- Device from which to load primary bootloader. Value depends on a variety of factors. See macppc/ofwboot(8).
boot-file
- Kernel location. Value depends on a variety of factors. See macppc/ofwboot(8).
input-device
- What type of console input device (ADB keyboard, USB keyboard, or serial
port).
- kbd
- ADB keyboard on models with ADB, USB keyboard on models with USB, and built-in keyboard on laptops. This is the default on some Open Firmware 2.0.x machines and all Open Firmware 2.4 and 3 machines.
- ttya
- ‘Modem’ serial port on machines with serial ports. Properties are 38400 bps, 8 bits, no parity, 1 stop bit, no handshaking. This is the default on all Open Firmware 1.0.5 systems and some Open Firmware 2.0.x systems.
- ttyb
- ‘Printer’ serial port on machines with serial ports. Properties are the same as the ‘Modem’ port.
- scca
- Serial port on Xserve models. Properties are 57600 bps, 8 bits, no parity, 1 stop bit, no handshaking.
- output-device
- What type of console output device (On-board video, AGP video, PCI video, built-in LCD, or serial console). Value depends on a variety of factors. See macppc/ofwboot(8) and http://www.NetBSD.org/ports/macppc/faq.html#ofw-input-output-devices
- nvramrc
- If ‘
use-nvramrc?
’ is set to true, these FORTH commands will be run when the computer is reset
Normal Operation
When Open Firmware loads the primary bootloader, it will print something like the following:
loading XCOFF tsize=CC50 dsize=14AC bsize=2668 entry=640000 SECTIONS: .text 00640000 00640000 0000CC50 000000E0 .data 0064D000 0064D000 000014AC 0000CD30 .bss 0064E4B0 0064E4B0 00002668 00000000 loading .text, done.. loading .data, done.. clearing .bss, done..
When macppc/ofwboot(8) is started, it prints something like the following:
>> NetBSD/macppc OpenFirmware Boot, Revision 1.7 >> (autobuild@tgm.daemon.org, Thu Feb 6 17:50:27 UTC 2003)
When macppc/ofwboot(8) is loading the kernel, it prints something like the following:
4395364+254568 [220144+193803]=0x4d477c start=0x100000
When the NetBSD kernel has started it prints a banner similar to the following:
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 1.6ZC (GENERIC) #0: Tue Sep 30 13:09:10 UTC 2003 autobuild@tgm.NetBSD.org:/autobuild/HEAD/macppc/OBJ/autobuild/HEAD/src/sys/arch/macppc/compile/GENERIC
After bootstrap
Once the NetBSD/macppc kernel is booted normally it initializes itself and proceeds to start the system. An automatic consistency check of the file systems takes place, and unless this fails, the system comes up to multi-user operation.
The proper way to shut the system down is with the shutdown(8) command.
If the system crashes, it will enter the kernel debugger, ddb(4), if it is configured in the kernel. If the crash occurred during initialization and the debugger is not present or is exited, the kernel will halt the system.
If the crash occurred during normal operation and the debugger is not present or is exited, the system will attempt a dump to the configured dump device (which will be automatically recovered with savecore(8) during the next bootstrap cycle), and after the dump is complete (successful or not) the kernel will attempt a reboot.
FILES
- /boot
- NetBSD secondary bootstrap program (Open Firmware 1.x and 2.x)
- /netbsd
- default NetBSD system kernel
- /usr/mdec/bootxx
- NetBSD primary bootstrap program (Open Firmware 1.x and 2.x) a.k.a. “partition zero” bootloader
- /usr/mdec/ofwboot
- NetBSD secondary bootstrap program (Open Firmware 1.x and 2.x)
- /usr/mdec/ofwboot.xcf
- primary bootstrap for netboot and “cd9660” (ISO 9660), “MS-DOS”, “HFS”, and “HFS+” file systems.
SEE ALSO
ddb(4), intro(4), diskless(8), halt(8), init(8), installboot(8), macppc/ofwboot(8), rc(8), reboot(8), savecore(8), shutdown(8)
http://www.NetBSD.org/ports/macppc/faq.html
http://www.NetBSD.org/docs/network/netboot/
STANDARDS
IEEE Std 1275-1994 (“Open Firmware”) http://playground.sun.com/1275/home.html
BUGS
The device names used by NetBSD/macppc and Open Firmware often have no relation to each other.
Apple Computer's Open Firmware implementation is easily confused.
It is best to reboot your computer after a failed boot attempt,
halt
, or shutdown -h
. Use
the Open Firmware reset-all
command.
Apple Computer's Open Firmware implementation is notoriously bad. Thorough instructions for installing and booting NetBSD are in the install notes (INSTALL.html) included with every release of NetBSD.