Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kokakoda

macrumors newbie
Original poster
Aug 29, 2021
1
13
Hey guys, first post here and it's gonna be a bit of a monster... I couldn't find a unified guide on all this anywhere, so here it is. I hope it helps someone avoid the frustrations I had. I'm intentionally being verbose here so this is as approachable as possible, sorry if sometimes it seems I'm stating the obvious.

I've been trying to get all four of these to boot from a single machine, and if you've tried it yourself you'll be well aware of all the issues that can crop up. After many (MANY) attempts, more reinstalls than I care to count and much cursing throughout, I've finally got them all to play nice together.

Now be warned, this isn't for the faint of heart. We'll be doing things "the hard way" to work around some of the issues, and there's some low-level plumbing involved. I'll try not to make too many assumptions other than that you have OSX (Tiger or Leopard will be required for the prep stage, but at install time you can use any PPC version of OSX) already installed somewhere.

Although this guide is targetted to the Mini, it's all applicable to other somewhat compatible hardware like iBooks and PowerBooks too, just get the correct OS9 disc for your hardware.

WHY DOES THIS NEED A GUIDE?

So basically, it all boils down to the APM (Apple Partition Map) getting messed up. You can install all of these on their own and have no problem. Dual-booting is usually no issue either, but things start getting weird around the time you get to the third OS. You'll find one or more of your OSes mysteriously unbootable, you'll get weird errors in the installers, the drive will appears to be uninitialised etc. It doesn't help that OSX inserts 128MiB partitions if it can, and re-enumerates the partitions as it sees fit. APM has a hard limit of 16 partitions, you see - but the OS9 drivers will claim most of these, leaving you with little wiggle room.

SO, HOW DO WE DO IT?

In brief, we'll be prepping all the partitions beforehand to minimise the risk of the APM getting stomped on. We'll do some things by hand to work around some bugs, and we'll make a backup of the APM in case of any errors.

WHAT YOU'LL NEED:

All the OSes, of course -
Latest OS9 disc for Mini from the guys over at macos9lives.com here.
A copy of X - this can be from the original system restore discs if you have them, or if you have another machine handy then Target Disk Mode will work too.
MorphOS, latest version at the time of writing is 3.15.
Linux - For this guide we'll be using the Macbuntu 12.04 Remix by @wicknix from this very forum. Anything using yaboot should be a drop-in replacement, but you'll need to make adjustments if using something that boots with GRUB.
And lastly,
Coriolis Systems' iPartition to make the initial prep a lot easier. If you have a bootable external you can run it from there, otherwise make an iPartition boot disc to work from.

Still reading? OK, let's get started...

First, we'll need to prep the drive for OS9. This is best done with Tiger, simply select the option to "install Mac OS 9 drivers" while erasing the drive in Disk Utility. If you only have Leopard available, you can use the OS9 installer to wipe the drive with Drive Setup (a single partition will be fine for now).

Now that we've got the OS9 drivers installed, load up iPartition. Boot from the disc if you made one, or connect your Macs together and put the Mini into Target Disc Mode.

If you used OS9 and Leopard to prep the drive, blow away the partition that's there. If your drive's bigger than 128GB, you'll also want to expand the partition table to fit the drive (menu > Partition Map > Expand Partition Map).

Now, create partitions as follows, selecting to put each at the beginning of the drive:

Boot (doesn't have to be at the start of the drive, but the name is non-negotiable)
Type: Apple Boot
Size: 64MiB
Flags: Valid, allocated, readable, writeable, disable automount
Format: no

NewWorld Bootblock (call this what you like, again doesn't have to be at the start)
Type: Apple Boot (should apparently be Apple Bootblock, but don't worry too much about it)
Size: 800 KiB
Flags: Valid, allocated, readable, writeable; disable automount
Format: no

Mac OS 9 (name whatever, has to be near the start of the drive)
Type: HFS
Size: as you see fit
Flags: Valid, readable, writeable; disable automount
Format: yes, as HFS+, non-journalled

Tiger (again, anything you like; anywhere you like)
Type: HFS
Size: whatever
Flags: Valid, readable, writeable; disable automount
Format: yes, HFS+; journalled usually unless you plan on writing to the partition with OS9, in which case select unjournalled.

Morph (yup, any name will do, wherever you want)
Type: Other, enter MorphOS_0x53465300 in the text field
Size: anything
Flags: Valid, allocated, in use, bootable, readable, writeable; disable automount
Format: no

Linux (you guessed it)
Type: Linux Ext2
Size: whatever is left over
Flags: Valid, allocated, readable, writeable; disable automount
Format: no
Don't create any swap partition, we'll add a swapfile later. Only 16 partitions, remember?

Why disable automounting you ask? Well, I wanted to be absolutely sure that the partitions remained untouched until they're needed. OS 9 will dump a load of hidden files on your partition if it can read it, as will X. 9 will switch itself back on when we install, and we can come back to iPartition at the end to turn these flags back on when we're finalising everything.

Hit Go and wait a few moments. OK, so everything's in place now and at the bottom you should see "Free space: 0 byte(s)". This is important, if you have any gaps then OSX will claim one of your 16 partitions and label it as "Apple Free". We don't want that.

Now, if you follow this guide then this next part shouldn't be necessary, but do it anyway. You'll thank me later if things go haywire. Take note of the BSD device name for your hard drive from the top-left of iPartition (/dev/rdisk0 in my image above, likely /dev/rdisk1 for you). Now, pop open a Terminal window and type:

Code:
sudo dd if=/dev/rdiskX of=partmap.bak count=1824

where X is your device number. What this will do is copy the partition map and all the OS9 drivers to a file which can be set aside somewhere until needed. You may be able to get away with just the partition map itself (i.e. the first 63 blocks) but I wanted to capture all the drivers too as well as any hidden attributes.

Okay, now we can start installing. Let's go ahead and boot from the OS9 disc. Close Drive Setup when it loads, since the drive's already prepped. Open the CD from the desktop, load up Apple Software Restore and restore the image, selecting the OS9 partition as the target. Allow it to wipe the partition again. Let it do its thing and then eject and reboot once you're done.

Next, we'll tackle MorphOS. Now the Morph installer doesn't play well with the OS 9 driver partitions, even if it allows you to install you'll find OS9 unbootable. Instead, we'll install manually, in a manner not unlike an OS9-style "drag install".

Double-click the MorphOS CD and goto Tools, then open Mounter. Select the ide.device unit 0, your internal drive. Find the Boot partition in the list, make sure you select Mac HFS as the filesystem type, and click Mount. Then find the MorphOS partition, select MorphOS SFS as partition type and mount that too. Close the mounter.

Now open Format from the Tools window. Select the Boot partition on the left, make sure its label also says Boot, and do a quick format. Select the Morph partition and do the same. Close the Format window.

Next, open both the Boot and Morph drives from the desktop, and open the CD root again. On the CD window, select the button that says Icons in the top right, and change it to All Files. Drag all the files to the Morph window, except the macppc_32 and macppc_64 drawers. You don't need the various Amiga booters (Efika etc) but let's not worry about a couple of megs right now. Open the WBStartup drawer in your Morph window and trash the First Flight icon. Open the mac_ppc32 drawer and drag everything in there to the Boot window.

Once that's done, open a shell from Tools. Type:

Code:
hfssetmacboot Boot:bootinfo.txt

and then reboot.

OK, 2 down. Luckily the OSX part of this is easy assuming you filled the drive earlier, just go ahead and install X as normal, either a fresh install or a previous backup made with CCC or SuperDuper.

Once X is installed, reboot and open the Startup Manager (hold option/alt while booting). Time for a quick status check. With luck, you'll see 3 OSes installed, and they should all be bootable - but don't just yet. Boot the Linux DVD.

Once at the desktop, open a terminal (Apple menu > Accessories > LXTerminal).

Type:

Code:
sudo mac-fdisk -l

Note down the partition numbers where everything lives. for Linux (e.g. /dev/sda9), we'll call this X; and the bootstrap partition Y. Make sure that your OS9 drivers are still in place: you'll see Drivers 1 through 4 at the bottom. If not, something's gone wrong somewhere. If that's the case, fetch the backup we made earlier and run:

Code:
sudo dd if=/path/to/partmap.bak of=/dev/sda
sync

and reboot back into Linux again.

Now everything should be consistent. In the terminal again, we'll now format and create our filesystem:

Code:
sudo mkfs.ext2 /dev/sdaX

where X is the partition number you noted down previously. I went with ext2 here so I can access the partition from OSX; if you aren't bothered about this then ext4 is a better choice, if you have another preferred filesystem type (like btrfs maybe) then use that instead.

Launch the installer. When asked, select "something else" when Lubuntu asks how you want to set up your drive. Select the Linux partition and assign it to "/" (root), and proceed. It'll complain about not having a swap partition, ignore this and continue.

Once installed, don't reboot yet. You probably got an installer error - I did at least. Go back to the terminal and run the following:

Code:
sudo yabootconfig -t /target -b /dev/sdaY
cd /target
dd if=/dev/zero of=swapfile bs=4M count=512
sudo chown root:root swapfile
sudo chmod 600 swapfile
sudo mkswap swapfile
sudo nano etc/fstab

where Y on the first line is your bootstrap partition. Now, at the end of the file, add:

Code:
/swapfile    none    swap    sw    0    0

OK, if you've got this far - congratulations. If you're happy to use Startup Manager to boot each time, you're pretty much done and can now boot into all 4 OSes at will. Go ahead and test everything now, make sure you can boot into everything. I'll go a little further though - I like to set up the yaboot menu so that if any bootfile becomes unblessed for whatever reason I can chainload it from there. Boot into Linux when you're done testing.

Mount the bootstrap partition and open your yaboot.conf. In a terminal:

Code:
sudo mount /dev/sdaY /mnt
nano /mnt/yaboot.conf

Add lines to the file after the "magicboot=" line but before the "image=" line:

Code:
macos=/dev/sda12
macosx=/dev/sda13
enablecdboot
enableofboot

subbing 12 and 13 for the partition numbers in your setup. You can enablenetboot too if you like, but I don't use that. Now run:

Bash:
sudo ybin -v

But what about MorphOS? Well, as yaboot is unaware of MorphOS, we'll need to add that manually. Edit /mnt/ofboot.b.

Now, to avoid any typos, copy one of the existing lines starting ": bootmacos" (CTRL-K in nano, CTRL-U twice to duplicate it) and modify it - change the start to ": bootmorphos", change the section "Booting MacOS" to "Booting MorphOS" and change the OpenFirmware partnumber to the Boot partition (10 in my case). It should look like this:

Code:
: bootmorphos " Booting MorphOS..." .printf 100ms load-base release-load-area " /pci@f4000000/ata-6@d/@0:10,\\:tbxi" $boot ;

In the "First Stage Ubuntu Bootstrap" section, modify it as follows:

Code:
" Press l for GNU/Linux,"(0d 0a)" .printf
" Press 9 for MacOS 9,"(0d 0a)" .printf
" Press x for MacOSX,"(0d 0a)" .printf
" Press m for MorphOS,"(0d 0a)" .printf

and finally, the case statement:

Code:
begin
    key? if
        key case
            ascii l of " l "(0d 0a): .printf bootyaboot endof
            ascii 9 of " 9 "(0d 0a): .printf bootmacos endof
            ascii x of " x "(0d 0a): .printf bootmacosx endof
            ascii m of " m "(0d 0a): .printf bootmorphos endof

Hope that's all clear enough, let me know below if not and I'll attach my whole ofboot.b for reference.

Unfortunately, this now won't be blessed and if you run ybin it'll blow away our changes. Let's boot into MorphOS again and bless it. Mount the bootstrap partition, open a shell and run:

Code:
hfssetmacboot bootstrap:ofboot.b

where bootstrap is the volume name in MorphOS of the partition.

Phew. Told you it was a monster. All that's left to do now is to hop back to iPartition and set any partitions back to automounting that you want to do so.

Don't think I missed anything or made any typos, but it's been a long day/night and there may be some errors. If anyone tries this, let me know the results, good or bad. I'll update any mistakes or glaring omissions after some much needed rest.

Exercise to the reader - you should have a couple of partitions left over if you did everything as above. Throw Haiku into the mix and make a penta-boot. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.