Re: setenv boot-device hd:XX,ofboot.b


Subject: Re: setenv boot-device hd:XX,ofboot.b
From: Timothy A. Seufert (tas@mindspring.com)
Date: Sun Jul 22 2001 - 02:22:05 MDT


At 4:29 PM -0700 7/21/01, perry phillips wrote:
>Well, this actually came up on this list once before and someone said
>the comma worked for them so I had assumed it made no difference. Indeed
>the command with comma did seem to do +something+, but it never fixed
>the problem. (i.e., "setenv boot-device hd:XX,ofboot,b")
>
>But I was pleasantly shocked to find that substituting a period for the
>comma actually restored the bootloader on my G3 pismo!
>
>Tim: thanks for this suggestion! I considered the period/comma debate a
>dead issue and was spending more and more time obsessing on ybin and
>Open Firmware details.
>
>For anyone who wants to come back and say the comma also works, I tried
>it it 4 times without success. If someone succeeded using the comma, I
>have no explanation for wacky stuff like this.
>
>I noticed in ybin it is "ofboot.b"--but hey, the comma worked for someone
>and it was verbatim advice from Dan Burcaw @ TS.

I would be VERY surprised if anybody actually had it working with
"ofboot,b". If somebody thought they had a working config like that,
they were almost certainly mistaken. See below.

>Still hoping someone will give a crude overview of the order of boot call
>procedures...

The basics:

Step #1: Open Firmware initializes hardware.

Step #2: OF looks at the "boot-device" OF environment variable (which
is kept in nonvolatile memory so it's remembered across power cycles)
to figure out where it should look for something to boot.

Step #3: OF attempts to load whatever "boot-device" points at. If it
succeeds, it transfers control to the code that was loaded. If it
fails, it goes through some fallback routines which try to scan for
MacOS ROM files and the like.

When ybin sets up a bootstrap partition, it creates an Open Firmware
script named ofboot.b in the partition's root directory. This script
is what provides the textual boot menu, and is a suitable target for
OF to load in steps 2 and 3.

So, when you type

   setenv boot-device hd:XX,ofboot.b

you are simply telling Open Firmware where to find ofboot.b. "hd" is
an Open Firmware alias that Apple puts into all their OF
environments; it points to the master device on the primary ATA bus.
"XX" is the partition number to look at on "hd". The characters
after the comma are what file to load from the specified drive and
partition. The comma and colon are simply separator characters.

So -- the failures when using "ofboot,b" are simply because OF can't
find any file with that name.

The only other way to get ofboot.b to load is something similar to this:

   hd:,\\:tbxi

This is a special code which tells Open Firmware to scan each
partition of "hd" for a file with the Macintosh creator code "tbxi",
and load the first one it finds. Usually such files are Classic
MacOS ROM files, but ybin creates ofboot.b with the creator code tbxi
so it can be recognized by this scanning routine.

   Tim Seufert



This archive was generated by hypermail 2a24 : Sun Jul 22 2001 - 01:30:19 MDT