Subject: Re: Open Firmware 3 Boot, revisited
To: Dan LaBell <dan4l-nospam@verizon.net>
From: Dan LaBell <dan4l-nospam@verizon.net>
List: port-macppc
Date: 03/01/2005 01:20:03
On Monday, February 28, 2005, at 09:05 PM, Dan LaBell wrote:
> ---bootbsd.of----------
> \ netbsd open-firmware boot command
> ." hello1" cr
> "screen" output
> ." hello2" cr
> boot hd:,\ofwboot.xcf hd:9,/netbsd
> ----------------------------------
> And I can autoboot my g3.    HMM..  actually just noticed typo  should 
> be " screen" ...but
> it is what worked... I'll post again after I try on my ibook.  maybe 
> ." does the init
> for screen...
>

It does work on my ibook.  "screen" and " screen" seem to be equivalent 
  maybe this is from ansiforth??? Or maybe just openfirmware.  At any 
rate, they both put the the address of the string /and/ string length 
on the stack.  My forth is very rusty, I actually learned it ages ago, 
before C or unix, but the way to print a string was w/ type, and
"screen" type
" screen" type
produce the same output.  Actually, I remember doing count type... but 
anyway
So the trick is basically, what you tried, but in a separate file.
----------bootbsd.of------------
"screen" output
boot hd:,\ofwboot.xcf hd:9,/netbsd
---------------------------------
Then setenv boot-command boot hd:,\bootbsd.of.
Adjusting boot commands to match.
Leave boot-device, and boot-file as set by mac, and mac-boot still 
works, either at
OF-prompt, in file., and you can edit the file and change your kernel, 
w/o touching
nvram, or openfirmware.

The forth commands can't seem to print to the screen, kinda puts the a 
damper on my menu plans, but they aren't really needed anyway. I'm 
thinking Apple didn't want to see
any forth stuff, so they turn the screen off, and turn it on in 
graphics mode inside
of mac-boot, if you need to select the startup folder (what happens if 
you hold 'option') or later in bootx , and then maybe the forth 
intepret-loop, "quit" turns the screen back on.  AND, in fact, it 
probably is, as I can insert
quit as the top line of "bootbsd.of" and boot into open-firmware w/o 
changing nvram, or holding option-command-o-f, and screen works.