Let me know if you feel that boot0 can be replaced in it's entirety with boot0md (I'd prefer this).
The only reason I know for using the original boot0 is as Zef posted, in that if the user has an HDD with two HFS partitions both installed with boot1h/boot then they could choose which partition to use by setting the active flag. In this case two versions of boot0 are still required and I can't see how one boot0 could cater for all situations.
I'll think about it, but it seems you'll have to keep boot0 as is.
It seems it will be possible to make one universal boot0. But before that I'll write down simplified explanation for each boot0 version. It helps me to see what's going on. I hope I did not make mistakes there ...
boot0:
------
for the boot drive only:
- Pass1:
- searches MBR partition table for an active bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT array and boots it
- if still not found, then continues with Pass2
- Pass2:
- searches MBR partition table for a first HFS+ bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT array and boots it
- if still not found, then finishes with "boot0: error"
boot0hfs:
------
for the boot drive only:
- Pass1:
- searches MBR partition table for a first HFS+ bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT array and boots it
- if still not found, then continues with Pass2
- Pass2:
- searches MBR partition table for an active bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT array and boots it
- if still not found, then finishes with "boot0: error"
boot0md:
------
- Pass1:
- iterates over all drives and for each drive:
- searches MBR partition table for the first HSF+ bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT array and boots it
- if still not found, then continues with the next drive
- if all drives are searched and nothing found, then continues with Pass2
- Pass2:
- iterates over all drives and for each drive:
- searches MBR partition table for the first active bootable partition and boots it
- if not found and disk is actually GPT, then searches for the first HFS+ bootable
partition (or EFI with boot1f32) in the GPT and boots it
- if still not found, then continues with the next drive
- if all drives are searched and nothing found, finishes with "boot0: error"
Bootable partition above means a partition with the boot sector signature (0xAA55) at the end of the partition boot sector.
Drives are searched (boot0md) in the order defined in the BIOS. Drive which is selected as the boot drive is searched first.
Few conclusions from the above:
----
boot0, boot0hfs and boot0md behaves differently only if booted from MBR or hybrid discs, while if booting from GPT disks they do the same: boot first HFS+ partition.
Active partition exists only on MBR or hybrid discs and can be used with boot0. There is no such equivalent on GPT disks. If somebody wants to load Chameleon from some other HFS+ partition, one solution is to make that one bootable (install Chameleon on it) and other HFS+ partitions not bootable by overwriting boot sector signature 0xAA55 with something else. If somebody is inspired, make a script for making some partition bootable/not-bootable and we'll have active partition equivalent on GPT.
There are some redundant steps in the above code (constant check for GTP disk), but that's how it is now. It's redundant, but does not cause any harm.
Later added "(or EFI with boot1f32)" since I forgot that.