Subject: Re: MacPPc again
To: Igor N. Green <green@unix.kg>
From: Henry B. Hotz <hotz@jpl.nasa.gov>
List: port-macppc
Date: 10/28/1999 15:45:06
At 3:59 PM -0700 10/27/99, Igor N. Green wrote:
>I installed it. finally. but.. how can I make it boot from the hard drive?
>I can see nothing but an image of a floppy and an X inside.
>I understand that those questions come from my not understaning how Macs
>are working, but still... I dont' know and I really want to know.
>so please do not flame me, I'm just a [l]user in Mac.
>I canmount those partitions : wd0a and wd0g if I boot from floppy.
>the question is how to make this MAc boot from the HDD.

Seems like some of this should be in the FAQ's, but I haven't looked at
them in a while.  Correct me people if I mislead our user.  I'm doing all
this from memory.

This information applies to PCI-bus PowerMac's.

On boot the machine starts running a monitor system called Open Firmware.
It's an IEEE standard, similar to what Sun uses for their boot PROM's.  It
allows you to do simple stuff with the machine, including inspecting what
devices are connected, running Forth programs, and saving information to
nvram which controls how the machine is supposed to boot.

The normal configuration of the machine tells it to boot from a certain ROM
area, which in turn will in turn search for a bootable version of MacOS.
If the auto-boot (sp?) variable is set false (or cmd-option-O-F are held on
the keyboard during boot) then the machine will come up with a command line
interface to Open Firmware that will allow you to access all the things
Open Firmare does.  setenv and printenv are the commands to manipulate
these variables.

The command bye will make the machine boot that ROM area and in turn MacOS
also.  One of the things MacOS always does is reset the Open Firmware boot
variables to make it boot MacOS the next time the machine restarts.  So OF
variables are not as permanent as their being saved to nvram would make you
think.

There's another wrinkle.  For the machines I have access to (7500 and 8500)
the default input and output devices for Open Firmware are one of the
serial ports.  In order to use Open Firmware I cannot just use the
four-finger keyboard salute.  I need to use a utility called Boot Variables
under MacOS in order to set the input-device and output-device variables to
kbd, and /chaos/control respectively.  Some machines allow /screen for the
latter.  Some machines require you to specify the entire device path
through the PCI bus controller to the specific display card installed on
your machine.

In order to look at the device tree for your machine the commands to use
are dev, devalias, pwd, and ls, if I remember correctly.  They are just
enough different from unix to be confusing, but similar enough that you may
get somewhere by just trying things.  The dev command is similar to unix
cd, but for the device tree.

From reading this list I gather that the normal way to set up a machine to
boot NetBSD directly is to use a utility called installboot (it's on the
boot floppy) to create a fake MacOS partition table and a pseudo partition
containing the ofwboot program.  It in turn boots the NetBSD kernel, and
then you are in normal unix-land.  You would need to set the boot variables
in Open Firmware to point at the right file.

Older versions of Open Firmware need a simplified version of XCOFF binary
to load.  I think version 3 and up understands elf binaries, so make sure
you have the right version of ofwboot for your machine.

Within the last few weeks NetBSD-current has acquired the ability to use
MacOS partition maps (lifted from the 68k Mac port of NetBSD).  This means
you don't use NetBSD's disklabel program to partition disks, but rather
take your pick of MacOS utilities to create "A/UX" partitions for NetBSD,
just as you would for MacOS X, or LinuxPPC.  (A/UX was a port of SVR2 to
68k hardware that Apple supported for a while around 10 years ago.)  It
should now be possible to just copy the ofwboot.xcoff program to a MacOS
partition and tell Open Firmware to boot it.  Open Firmware understands
MacOS partitioning, but not NetBSD disklabels.

For the machines I have access to the relevant device aliases for booting
are fd, for the floppy, scsi, for the external scsi bus, and scsi-int, for
the internal scsi bus.  "boot scsi-int/@3:0,OFWBOOT.XCO" should boot the
file OFWBOOT.XCO from the raw partition of the CD-ROM at SCSI ID 3.  "boot
scsi-int/@0:5,ofwboot.elf" may work for a file called ofwboot.elf on a
normal MacOS partition of the internal disk of many machines.  There are
several overhead partitions containing patches and driver code at the
beginning of a normal MacOS disk so something like 5 is the actual number
for the first real MacOS partition.

I know I'm glossing over some stuff, but I think this should get you
oriented.  If any of it isn't in the FAQ's it should be.

I also know how frustrating it is to deal with a strange machine just to
get to an OS you know.  I just bought a used PC to run NetBSD.  Installing
NetBSD from the CD was a breeze, but I still haven't been able to install
windows in the partition I reserved for the purpose.  Unlike Apple nobody
has been able to blow away all the legacy harware quirks on the PC.  Why
should I *care* what you do with A20 on the ISA bus, and why does that
affect the keyboard?  Fortunately the defaults that the NetBSD installer
chose seem to work.

Signature failed Preliminary Design Review.
Feasibility of a new signature is currently being evaluated.
h.b.hotz@jpl.nasa.gov, or hbhotz@oxy.edu