Dual boot OSX from Vista with two HFS partitions

#1
Greetings, looking for some help:

I used EasyBCD to set up a BCD entry to boot OSX and all was working fine until I reformatted partition 1 (which was previously unused) as HFS. I now get the dreaded 'chain boot error'.

My hard disk now looks like this (4 primary partitions):
Partition 1: HFS, data
Partition 2: NTFS, Vista installed, marked as the active partition
Partition 3: HFS, Leopard installed and know to work
Partition 4: NTFS, data

I think what must be happening is that C:\NST\nst_mac.mbr is trying to boot partition 1 rather than partition 3 and there is, of course, no OS there. Is there any way I can tell it which partition I want it to boot from, or maybe there is something I can put on partition 1 to 'redirect' it to partition 3.

EasyBCD is a great product by the way, hats off to you guys.

TIA and happy hacking.

Addendum:

OK, I found a way. Not a good way, but a way that works for me.

I had a look inside nst_mac.mbr and it works its way through the partition table looking for one with the right partition type (AF, A8 or AB). It then tries to boot it. So I patched it to start looking at partition 3, eh voila! Problem solved.

If anyone wants this horrible hack I will be pleased to post the file. I'd still like to know how to do this properly.
 
Last edited:

mqudsi

Mostly Harmless
Staff member
#2
Hiya snifferdog, welcome to NST.

We're well aware of this problem - the blame lies squarely in Apple's field. Unlike other software vendors (even Microsoft), they do everything they can to make it impossible to interface with their OS and understand how it works. Their OS documentation is horribly lacking, and their APIs are almost non-existent.

Due to the lack of documentation and support for interfacing with the OS X boot procedure, third-party developers such as NeoSmart Technologies have had to resort to ugly hacks and workarounds to get some measure of compatibility with Apple's OS and to give our users something that works, even if not fully.

EasyBCD 2.0 will hopefully address this particular problem by optionally patching nst_mac.mbr to load up a particular partition instead of searching manually for AF partitions to boot into; while retaining the current 1-click support for automated loading since it works well for most of our users.

Can you send me any modifications you've made to ComputerGuru@NeoSmart.net?

Thanks!
 
#3
Hi CG, thank you. It's on its way to you.

Here are details of the patch in case anyone is interested. It starts looking for an HFS partition at partition 3 (since that is what I wanted) rather than partition 1. The patch starts at offset 0x79 in the file. I had to knock out the 'AA55' bootable disk signature check to fit it in:

fc /b nst_mac.mbr.org nst_mac.mbr.patched
Comparing files nst_mac.mbr.org and nst_mac.mbr.patched
00000079: 81 89
0000007A: 7D FE
0000007B: 40 83
0000007C: 55 C6
0000007D: AA 20
0000007E: 0F B9
0000007F: 85 02
00000080: 8B 00
00000081: 00 90
00000082: 89 90
00000083: FE 90
00000084: B9 90
00000085: 04 90
00000086: 00 90
To boot a different partition, set the byte at 0x7D as follows:
00 = boot partition 1
10 = boot partition 2
20 = boot partition 3
30 = boot partition 4

You should also set the byte at offset 7F to the number of partitions to scan (i.e 4, 3, 2 or 1 respectively).

To inspect the code, download something called BIEW (from http://www.thefreecountry.com/). I would post it here but this editor keeps mangling it.