Subject: Re: Open Firmware 3 Boot, revisited
To: Dan LaBell <dan4l-nospam@verizon.net>
From: Daniel Eggert <danieleggert@mac.com>
List: port-macppc
Date: 02/28/2005 23:18:29
On Feb 28, 2005, at 10:51 PM, Dan LaBell wrote:

> Generally, forth is postfix and either interprets tokens (sep. by 
> whitespace) as numbers or address and places them on the stack, or as 
> a 'word' or function and runs it.  However, words can manipulate the 
> line being read, taking over the parsing, that's why you need a space 
> around ", it's actually an operator like +, but it takes over parsing 
> and reads until next " , makes that into a string , (allocates memory 
> for it) and leaves address on the stack.  So " screen" output, is 
> actually passing an address to output.
>
>>>> setenv boot-command " screen" output boot
>
> Setenv also parses the line, that's how it apparently provides 
> "prefix/normal" interface.
> Also, it means you can't just paste other forth stuff into it, 
> because it won't work.
> Mainly, because setenv isn't really 'normal' forth, also, neither is 
> boot, for that matter.
> To make matters more confusing, the trick only works in interpreted 
> mode when there's an line being parsed in, in 'compiled mode' or 
> inside a function, it won't.  I rediscovered this aspect of forth, 
> when I was experimenting with an interactive boot menu,  since I 
> factored my menu into other functions, I hit a snag as I couldn't 
> just use straight forward boot commands I was used to.
>
> At any rate, the CD just wants to set the output once, for 1 boot 
> only, and doesn't mess w/ the nvram, setenv sets nvram. In fact, it 
> should already be 'screen', but if it needs setting I think:
>  setenv output-device screen
> would work, you can check current setting with printenv.

OK. I got that. But output is set to screen.

> What's the machine doing right now? Also, wasn't that for machines 
> were OF defaulted to serial?  Machines where option-command-o-f would 
> put the ok prompt on a serial line?.
> Isn't this a mini?  I'm thinking you want you leave boot-command 
> alone, and try boot-file.
> And experiment maybe by wrapping the boot file: make a text file, 
> boot that
> and, at the bottom execute boot again with your parameters: something 
> like:
> ------------of.boot--------------
> \ need comment first line
> ." boot1" cr
> " screen" output
> ." boot2" cr
> boot hd:,\ofwboot.xcf
> ----------------------------------
> Changing last line to match, what you need, sorry I deleted the email 
> w/ the boot command. I don't know if you need to set output, but this 
> way you can rip from other boot scripts,
> it will parse the same way. Boot like boot hd:,\of.boot .

Now you lost me again. What will
     ." boot1" cr
do? Is that file to circumvent the parsing done by setenv?

Yes: It's a mini, and the output defaults to screen, and is set to 
default, i.e. screen. If I cmd-opt-o-f the screen comes up fine, but if 
I just boot with auto-boot? set to true the screen never comes up. 
There's no sync signal on the VGA.

/Daniel