Jump to content

Clean multibooting with GRUB working!

4 posts in this topic

Recommended Posts



I've been following the OSx86 progress for a while, and was wondering what OSX was like... so I've decided to install OSX, giving it a shot :D


Now I've these OS's installed on my laptop: Debian, WinXP (factory-installed), OSx86 10.5. They all reside on a logical partition.

Everything works fine, except booting OSX! - Well out of curiosity, I've additionally installed an older OSX (Tiger 10.4.8), and it was able to boot from GRUB! Ok, so there was something wrong with my Leopard... strange enough, the Leopard installer didn't install any bootloaders on the MBR, nor on the Partiton's bootrecord. The latter was just zeroed out.

After some tinkering on my installation, everything was working fine! A super clean multiboot to all three OS's via GRUB! :D :D




One possible solution was letting the installation DVD in the drive, booting from it, letting the counter go to zero, and booting OSX from HDD this way. Well actually this is just a real PITA workaround as many of us know. :P

In this forums I couldn't find another solution to my problem. (or I'm just too stupid using the search function? ;))


So I've spent one day, disassembling the bootloaders (i.e. chain0, boot0, boot1h) trying to understand what was going wrong. After that, I came to the conclusion, that booting Leopard from GRUB (or ANY OTHER OS booters) was simply impossible - At least with my OSX installer...

The problems were:

1. Leopard's partition didn't have a boot loader. (boot sector was zeroed out)

2. The superblock (volume header) didn't contain a valid block pointer to the Darwin bootloader. (also, it was zeroed out) The loader is located at '/usr/standalone/i386/boot'.



Here's my solution to this problem: (only valid for HFS+ partitions!)

1. Set up GRUB:

1.1. Load boot0 (grab it from your OSX CD/installation) via chainloader.

1.2. Make your OSX partition active. Note for Vista users out here: Before booting Vista, make Vista active again, otherwise you won't be able to hiberate!

2. Set up OSX partition:

2.1. Put boot1h on the partition's bootsector.

2.2. Track down the start sector of the Darwin bootloader '/usr/standalone/i386/boot', using any suitable tool you can use.

2.3. Calculate it to the block index: IDX = sector / (blocksize / 512). E.g. in my case: Sector=12109368, Blocksize=4096, Idx=12109368/(4096/512)=12109368/8=1513671=0x001718C7.

2.4. Write it into the superblock at sector 2, offset 0x01c0. (big-endian)



Now I'm wondering...

1. Why didn't the installer contain a bootloader installer (or anything similar)?

2. Is there any tool (for Linux!) to find the block pointer of one file? Didn't read through the whole HFS+ specification, would have been a overkill!

3. What about fragmentation on HFS+ partitions? boot1h

4. What about UFS partitions? Haven't dug into the boot1u...



Feedbacks are welcome, and I'm also interested to know, whether this "fix" also works for other people out there. :D

You should be well aware and careful of what you're doing, otherweise you'll might ending up with an not-bootable system! In case of doubt, just boot OSX with the installer DVD. (in short: I can't be held responsible for any damages caused by this "howto". :|)





Link to comment
Share on other sites

Rather than making OS X boot via grub like Windows (chainloader), you can boot it like a Linux kernel.

Here is how:


Get boot_v8 (The pc_efi bootloader -- Google "pc_efi v8.0 download)


Copy it to /boot inside linux


Then edit /boot/grub/menu.lst


title Mac OSX Leopard

root (hd?,?) (replace with same values grub uses for Linux partition, not ones for OSX partition)

kernel /boot/boot_v8



I think this is simpler, and it gets you EFI too.

Link to comment
Share on other sites

  • 2 weeks later...


Wow indeed, it's much simpler and easier than fiddling around the normal bootloader. And as a sideeffect, OSx86 re-recognizes my HDAudio ad1986 again. Seems that the EFI solution is much more stable?

Thanks a lot for that hint! (Darn, must have missed the EFI progress...) :D



I'd recommend using GRUB as bootloader - just because I don't use Acronis OS Selector :()

About the PS/2 keyboard... take a look in the wiki! (clicky). Or I'd simply suggest buying a PS2-to-USB adapter!

Link to comment
Share on other sites


  • Create New...