Subject: Re: Booter for Mac OS X 10.4 (Tiger) can boot NetBSD?
To: Donald Lee <MacPPC1@caution.icompute.com>
From: Robert Nestor <rnestor@murphy.dyndns.org>
List: port-macppc
Date: 05/28/2005 13:10:26
On May 28, 2005, at 10:40 AM, Donald Lee wrote:

> I seem to recall that someone wrote a menu-like IFace that could be
> put in forth's NVRAM.  What I would really like is a forth boot
> that could be set to default to one system, and boot it after a
> short timeout, but allow switching to an alternate on some keypress 
> (es).
>
> I know that Mac OS 9 won't allow this, because it scribbles on the
> forth settings. ;-<  In theory, it would be possible with Mac OS X,
> NetBSD, OpenBSD, etc.

Don,

If I understand you correctly I think I've done this on my B&W G3.  I  
used Yellow Dog Linux to get it working, but I think all you need to  
do is:
     1) Create a small partition on the disk to hold the primary  
bootstrap CHRP file and set the default boot to boot from this  
partition.  This doesn't have to be an HFS type partition, but it is  
easier to set up with OS 9 or OS X utilities if it is.  You can  
change the partition type to something else after you get it  
configured.  This is done for you by the YDL utilities but you can  
use pdisk to do it too.
     2) Place the attached CHRP file in the partition created in step  
#1. The file Creator code should be "chrp" and the file Type code  
should be "tbxi".

You'll need to edit the CHRP file to adjust for the partitions on  
your disk.  In my system partition 6 contains the CHRP bootstrap and  
the YDL Secondary Boot.  Partition 7 contains OS 9, 8 contains OS X,  
and 11 is my NetBSD Root.

When I boot I get a small menu that allows me to select what system I  
want to boot up.  I can also select a NetBoot or CDROM or even drop  
into Openfirmware.  If I don't select anything it defaults to OS X  
after about 10 seconds.  Also, on newer systems the multi-system boot  
prompt (the Opt key) should work.

Obviously to boot both NetBSD and OpenBSD you'll need to assign  
different keys to each.

-bob

<CHRP-BOOT>
<COMPATIBLE>
MacRISC MacRISC3
</COMPATIBLE>
<DESCRIPTION>
Yellow Dog Linux First Stage Bootstrap
</DESCRIPTION>
<BOOT-SCRIPT>
: .printf fb8-write drop ;
: bootyaboot " Loading second stage bootstrap..." .printf 100 ms load- 
base release-load-area " /pci@80000000/pci-bridge@d/pci-ata@1/@0/ 
disk@0:6,\\yaboot" $boot ;
: bootybsd " Booting BSD..." .printf 100 ms " /pci@80000000/pci- 
bridge@d/pci-ata@1/@0/disk@0:6,\\ofwboot netbsd" $boot ;
: bootmacos " Booting MacOS..." .printf 100 ms load-base release-load- 
area " /pci@80000000/pci-bridge@d/pci-ata@1/@0/disk@0:8,\\:tbxi" $boot ;
: bootmacosx " Booting MacOSX..." .printf 100 ms load-base release- 
load-area " /pci@80000000/pci-bridge@d/pci-ata@1/@0/disk@0:7,\\:tbxi"  
$boot ;
: bootcd " Booting CDROM..." .printf 100 ms load-base release-load- 
area " cd:,\\:tbxi" $boot ;
: bootnet " Booting Network..." .printf 100 ms load-base release-load- 
area " enet:0" $boot ;
: bootof " Booting OpenFirmware..." .printf 100 ms quit ;
" screen" output
variable interactive
1 interactive !

0 interactive @ = if
   bootyaboot
then

dev screen
" "(0000000000aa00aa0000aaaaaa0000aa00aaaa5500aaaaaa)" drop 0 7 set- 
colors
" "(5555555555ff55ff5555ffffff5555ff55ffffff55ffffff)" drop 8 15 set- 
colors
device-end
f to foreground-color
0 to background-color
" "(0C)" .printf

" First Stage Yellow Dog Linux Bootstrap"(0d 0a)" .printf
"  "(0d 0a)" .printf
" Press l for Yellow Dog Linux,"(0d 0a)" .printf
"       b for BSD,"(0d 0a)" .printf
"       m for MacOS,"(0d 0a)" .printf
"       x for MacOSX,"(0d 0a)" .printf
"       c for CDROM,"(0d 0a)" .printf
"       n for Network,"(0d 0a)" .printf
"       o for OpenFirmware."(0d 0a)" .printf
"  "(0d 0a)" .printf
" Stage 1 Boot: " .printf
get-msecs d# 10 3E8 * +
begin
   key? if
     key case
       ascii l of " l "(0d 0a)" .printf bootyaboot endof
       ascii b of " b "(0d 0a)" .printf bootybsd endof
       ascii m of " m "(0d 0a)" .printf bootmacos endof
       ascii x of " x "(0d 0a)" .printf bootmacosx endof
       ascii c of " c "(0d 0a)" .printf bootcd endof
       ascii n of " n "(0d 0a)" .printf bootnet endof
       ascii o of " o "(0d 0a)" .printf bootof endof
     endcase
   then
   dup get-msecs &lt;
until
drop
"  "(0d 0a)" .printf bootmacosx
</BOOT-SCRIPT>
<OS-BADGE-ICONS>
1010
000000000000F8FEACF6000000000000
0000000000F5FFFFFEFEF50000000000
00000000002BFAFEFAFCF70000000000
0000000000F65D5857812B0000000000
0000000000F5350B2F88560000000000
0000000000F6335708F8FE0000000000
00000000005600F600F5FD8100000000
00000000F9F8000000F5FAFFF8000000
000000008100F5F50000F6FEFE000000
000000F8F700F500F50000FCFFF70000
00000088F70000F50000F5FCFF2B0000
0000002F582A00F5000008ADE02C0000
00090B0A35A62B0000002D3B350A0000
000A0A0B0B3BF60000505E0B0A0B0A00
002E350B0B2F87FAFCF45F0B2E090000
00000007335FF82BF72B575907000000
000000000000ACFFFF81000000000000
000000000081FFFFFFFF810000000000
0000000000FBFFFFFFFFAC0000000000
000000000081DFDFDFFFFB0000000000
000000000081DD5F83FFFD0000000000
000000000081DDDF5EACFF0000000000
0000000000FDF981F981FFFF00000000
00000000FFACF9F9F981FFFFAC000000
00000000FFF98181F9F981FFFF000000
000000ACACF981F981F9F9FFFFAC0000
000000FFACF9F981F9F981FFFFFB0000
00000083DFFBF981F9F95EFFFFFC0000
005F5F5FDDFFFBF9F9F983DDDD5F0000
005F5F5F5FDD81F9F9E7DF5F5F5F5F00
0083DD5F5F83FFFFFFFFDF5F835F0000
000000FBDDDFACFBACFBDFDFFB000000
000000000000FFFFFFFF000000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFFFF00000000
00000000FFFFFFFFFFFFFFFFFF000000
00000000FFFFFFFFFFFFFFFFFF000000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFF000000
</OS-BADGE-ICONS>
</CHRP-BOOT>