Subject: ofwboot man page draft
To: None <port-macppc@netbsd.org>
From: Henry B. Hotz <hotz@jpl.nasa.gov>
List: port-macppc
Date: 11/02/2000 18:17:54
Please note that I have said more than I know in a few places.  In 
other places I have relied on perhaps inaccurate comments or perhaps 
incomplete understanding of the code.  Particular questions I have 
are:  1) Did I get the defaults for the variables correct?  2) Is the 
syntax for the long form of the OF boot command correct?  3) Can you 
really put an OF device in the Boot: prompt input?  Doesn't look like 
it from my reading of the code, but seems you *should* be able to. 
4) Do I have the correct version numbers in the History section?

I don't think bootpath and bootargs are supported in OF 1.0.5 so I 
don't understand where they might come from.  Be nice to mention them 
in here somewhere.

Double checks would *very* much be appreciated.

---------------------------

NAME
	ofwboot

SYNOPSIS
	boot {promdev[@id][:part],}ofwboot.{xcf,elf} exit
	boot {promdev[@id][:part],}ofwboot.{xcf,elf} -{a|s|d}[a|s|d...]
	boot {promdev[@id][:part],}ofwboot.{xcf,elf}
		[[promdev[{:|,}partition]]/]filename[ a|s|d...]

DESCRIPTION
	ofwboot is the primary boot loader for the Macintosh PowerPC 
port of NetBSD.  I depends on Open Firmware for it's I/O to read the 
NetBSD kernel.  If the command line options are missing or invalid it 
will read Open Firmware environment variables to get its options as 
described under ENVIRONMENT.  If it still can't load a file then the 
-a option is forced.

	The options are:
	-a	Print ``Boot:'' and read input, which overrides and 
has the same syntax as the other options.

	-s	Boot only to single-user mode.

	-d	Use kdb.

	exit	Quit back to Open Firmware.

	In addition a filename can be given followed by the above 
option letters without the `-' flag.  It can be a full path for some 
versions of Open Firmware on some filesystem types.  It can be 
preceded by an Open Firmware device path including unit number.  The 
partition number will be deleted on Open Firmware versions 1 and 2, 
and will be forced to zero on Open Firmware 3 or greater.

ENVIRONMENT
	Open Firmware environment variables can be displayed with 
printenv (no arguments) and set with setenv (same as under csh) from 
the Open Firmware command line.  Booting MacOS resets them.

	The following variables are relevant:

	auto-boot?	If true Open Firmware will immediately run 
the command in boot-command on startup.  If false Open Firmware will 
stop with a command line prompt.  Note that the -a option may not 
work correctly if set true.

	boot-command	The command to run at startup if auto-boot? 
is true.  Uually just ``boot''.

	boot-device	The default device to load from if not given 
as an argument to ofwboot.  If empty then defaults to the device 
ofwboot was loaded from.

	boot-file	The file to load if not given as an argument 
to ofwboot.  If empty then defaults to ``netbsd''.

EXAMPLES
	To boot from the boot floppy into the install kernel (on a 
machine with a floppy drive):

	boot fd:0,ofwboot.xcf netbsd.gz

	To boot ofwboot on a G4 from an appropriate CD-ROM so you can 
try different boot arguments:

	boot cd,ofwboot.elf -a

	To boot from an appropriately configured PowerMac {7,8}500 
internal hard disk you need the following environment variables set:

	boot-device	scsi-int/sd@0:0
	boot-file				(empty that is)

BUGS
	Apple's implementation of Open Firmware has more bugs than we 
can document here and booting on a PowerMac depends on working around 
all the ones we can find on each version.  Even getting access to the 
Open Firmware command line is difficult on some machines.  There are 
probably bugs in ofwboot too but they're minor in comparison.

SEE ALSO
	intro(9), the install instructions for the MacPPC port, the 
FAQ for the MacPPC port, the IEEE standard for Open Firmware.

HISTORY
	ofwboot first appeared in the Open Firmware port of NetBSD 
1.3.  It was first released in the MacPPC port of NetBSD 1.4.

Signature held pending an ISO 9000 compliant
signature design and approval process.
h.b.hotz@jpl.nasa.gov, or hbhotz@oxy.edu