Subject: Re: A NetBSD Boot Floppy to Load Open Firmware settings?
To: Anthony de Almeida Lopes <guerrilla_thought@gmx.de>
From: Dan LaBell <dan4l-nospam@verizon.net>
List: port-macppc
Date: 03/23/2005 15:32:43
On Mar 22, 2005, at 12:07 PM, Anthony de Almeida Lopes wrote:

> Hi, I was wondering if anyone would like to collaborate on creating a
> NetBSD boot floppy (probably a pair actually) for the sole purpose of
> loading Open Firmware settings.
I was just thinking about something like that.

>  I know that there are Linux utilities to
> edit Open Firmware settings once you are booted into Linux but I 
> believe
> that these are Linux-specific and operate on a Linux /dev entry.
>
> The reason for something for this is that many Macs loose their 
> firmware
> settings when their batter runs out or for various other reasons.
My battery on my imac g3 is gone, so I lose settings every time I lose 
power.

> For
> example, a PowerBook could loose it's settings if it's battery does not
> hold charge and it isn't plugged into an outlet. Another case would be
> when a desktop's PRAM (?) battery runs out and it isn't plugged into an
> outlet.  Another reason is that often when booting into MacOS, it will
> reset the firmware settings as well.
>
Not sure about that with me, but if I set the startup disk, it will 
change
boot-command to mac-boot, as well as boot-device, and bootfile.

> Having a disk like this would eliminate the need for carrying around a
> MacOS install or restore CD and a copy of System Disk. It would also
> simply the NetBSD install process.

Yes, and notes, or the install-docs.  Maybe just go wherever ofwboot.xcf
is.

> Does something like this exist already? I don't think so because if it
> did the install process wouldn't be the way it is.
> Is it possible? Linux can do it.
> Are there any copyright issues? I don't know, but I don't see a problem
I don't think there should be any issues unless we are making making 
are own
firmware to sell.  Forth is designed to be modified and extended.

> loading them.
> The other question is; is it necessary to boot into NetBSD at all? Can
> this be automated from within Open Firmware.
Might depend on the mac variants.  Might not be possible to directly 
boot
into a forth file w/o maybe wrapping it onto some kind of format, that 
macos likes,
as boot-command will be mac-boot unless its changed.  But, one could 
simplify, and
reduce the time spend in openfirmware and that could be good, like get 
into OF then:
boot hd:,\restoresettings.4th (etc),
and you're done.  It should be possible to have different branches for 
different macs, and possibly query user for optional settings.  And 
possible to edit the file to set specific defaults.

> I don't know, but I see
> that as a possibility. As long as Open Firmware can read the disk 
> format
> it can read the disk contents, but is it possible to load firmware
> settings from that disk into Open Firmware without typing it all in by
> hand.
Yes, and I just verified that it is, though I had to do " setenv " eval 
, not just setenv,
could also be done with $setenv, I think.  It was nested inside an if, 
inside a loop
though.

>
> Anyone have any comments, suggestions, questions or even interest?
> Let me know,
> -- Anthony
I'm interested.  I'm working on a boot menu right now as matter of 
fact.  If your interested I'll send it to you.  I plan to post it when 
it is more generalized and polished.  Right now it waits for a keypress 
indefinitely which is not-good, but I plan on fixing that today...

I also have some interest in an firmware forth partition lister.  This 
should be possible.
On a sun system which was openboot 2, I once managed to edit the 
password file to regain access after being locked out. I had user 
access to the system, which I used to learn the number of the first 
data block of the /etc/password, but rest was all forth --anyway
as that was possible, so should listing the partition map.