Voodooprojects

Chameleon => DevTalk => Patches => Topic started by: r0m30 on January 29, 2010, 11:21:27 PM

Title: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: r0m30 on January 29, 2010, 11:21:27 PM
If I'm out of line just let me know and I'll back off.

In my wonderings I noticed that the proposal to let Chameleon boot off a partition that wasn't the active partition didn't make it into the repo.  As Win7 penetrates the market (and we all know it will) I think Chameleon will run into more conflicts in multi-boot setups unless it allows Windows to own the active partition.  The biggest bully gets the best corner.

I've looked at the boot0 code and it looks like the feature was there but then it was commented out, not sure why.

I've attached what I think is needed to re-enable Chameleon booting from a non active partition, but I'm a 1 OS 1 Drive kind of guy, and I don't hve Win7 or use sleep, so I can't test it, maybe Blackosx can help there?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on January 30, 2010, 06:05:56 PM
maybe Blackosx can help there?
Hi r0m30

I can try and hep out here and I have played with dual booting before so I am happy to try things out, but I need you to let me know exactly how to do this.  Here's exactly what I have now so we can work out what the next step should be..

I have two HDD's each formatted with a GPT and each disk has Chameleon installed on to it's own separate partition.
Here's my diskutil list result, and Disk1 is my Snow Leopard install and I don't intend changing that one:

Code: [Select]
blackys-imac:~ blacky$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *465.8 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Chameleon               896.0 Mi   disk0s2
   3:                  Apple_HFS Macintosh               120.0 Gi   disk0s3
   4:       Microsoft Basic Data                         64.0 Gi    disk0s4
   5:                  Apple_HFS Backup                  16.0 Gi    disk0s5
   6:                  Apple_HFS Vault                   264.3 Gi   disk0s6
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *465.8 Gi   disk1
   1:                        EFI                         200.0 Mi   disk1s1
   2:                  Apple_HFS Cham                    1.0 Gi     disk1s2
   3:                  Apple_HFS SnowLeopard             120.0 Gi   disk1s3
   4:       Microsoft Basic Data WIN7                    80.0 Gi    disk1s4
   5:                  Apple_HFS BackupSL                16.0 Gi    disk1s5
   6:                  Apple_HFS Data                    248.1 Gi   disk1s6

For this trial I am using disk0 and I have just installed Windows7 on to disk0s4 and as things stand:
• If I select disk0 in BIOS, Windows 7 owns the system and takes over.
• If I select a bootable Chameleon USB stick from BIOS, I can boot the Macintosh partition on disk0s3.
• If I select disk1 in BIOS, Chameleon from disk1s2 loads and I can boot the Macintosh partition on disk0s3.

I have made the edit to boot0.s as shown in your diff file, recompiled Chameleon then written the new boot0 to disk0, and while at it also wrote boot1h back to disk0s2. This expectedly, results in the Windows Boot Manager complaining the drive is inaccessible, giving error STATUS: 0xc000000e. This I can easily repair with the Windows 7 CD and now Windows 7 is back to owning the system again.

I know I can use fdisk to set disk0s2 to the active partition and Chameleon will boot but I guess that's not the point of this trial. So my question is how do I trial the new boot0 file?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: r0m30 on January 31, 2010, 07:21:25 AM
I know I can use fdisk to set disk0s2 to the active partition and Chameleon will boot but I guess that's not the point of this trial. So my question is how do I trial the new boot0 file?

Yes, the object is to update the MBR boot code without changing the active partition from the win7 partition. I'm still a little vague about OSX device numbers, in linux disk0 (sata) would be sda and the partitions would be sda1 thru sda6.  If I understand OSX device numbering rdisk0 = sda and disk0s1...disk0s6 = sda1...sda6.  So, I think what you need to do is
Code: [Select]
sudo dd if=boot0 of=/dev/rdisk0 bs=440 count=1 Then boot from disk0 and see if Win7 will boot/sleep.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on January 31, 2010, 10:15:48 AM
So, I think what you need to do is
Code: [Select]
sudo dd if=boot0 of=/dev/rdisk0 bs=440 count=1 Then boot from disk0 and see if Win7 will boot/sleep.
Okay, I understand you now.. We are only going to write to the first 440 bytes of the MBR.

I wrote the modifed boot0 with this slightly amended command as using rdisk failed.
Code: [Select]
sudo dd if=boot0 of=/dev/disk0 bs=440 count=1 which completed successfully, and Windows7 still boots and sleeps fine though Windows7 is still the active partition and takes over. I have exactly the same results when using the unmodified boot0.

However, I did have some strange side effects earlier when having the modified boot0 installed:

• BIOS thinking my DVD drive was another HDD? selecting it from BIOS then showed me the 'Verifying DMI Pool Data....' message I get from my Gigabyte BIOS, then a flashing '_' symbol for about 30 seconds until finally reporting 'DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER'. Pressing enter then proceeded to boot Windows7.
• Selecting to boot my Snow Leopard HDD (disk1) from BIOS also presented me with the 'Verifying DMI Pool Data....' message I get from my Gigabyte BIOS, then a flashing '_' symbol for about 30 seconds until finally reporting "EBIOS read error: Device timeout" then on then next line "Block 0x0 Sectors 0". This scan then looped every 30 seconds.
• Even selecting to boot from my bootable Chameleon USB stick from BIOS also entered the same loop as above.

This must be because the change to boot0 now instructs it to search for an HFS+ partition regardless of whether it's active or not, but it fails to ever find Chameleon. I will try more tests....
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on January 31, 2010, 05:04:16 PM
Okay I have it working :)

Windows is the active partition and the modified boot0 is installed in to the first 440bytes of the MBR. When I boot, Chameleon runs and I can select either Windows7 or OS X. Windows7 boots fine and also sleeps.

But I had to modify boot0 further. What I did was comment out .Pass1 and just leave .Pass2
I don't know if there are any negative effects of doing this, but it works.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: r0m30 on February 01, 2010, 05:13:28 AM
Okay I have it working :)
Great  8)
But I had to modify boot0 further. What I did was comment out .Pass1 and just leave .Pass2
I don't know if there are any negative effects of doing this, but it works.
I know better than to ever say "small change" and I don't know of any ill effects either but I hope one of the Devs does.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 01, 2010, 08:29:12 AM
I have spoken to Rekursor since this and after looking at the change he suggested we keep the code for the first pass but just swap the pass2 code with the pass1 code so it checks first for a boot record regardless of it being active or not.

Code: [Select]
.testPass:
    cmp     bh, 1
    jne     .Pass2

.Pass1:
    cmp     BYTE [si + part.type], kPartTypeHFS ; In pass 2 we're going to find a HFS+ partition
    jne     .continue ; equipped with boot1h in its boot record
; regardless if it's active or not.
mov dh, 1 ; Argument for loadBootSector to check HFS+ partition signature.
    jmp    .tryToBoot

.Pass2:   
    cmp     BYTE [si + part.bootid], kPartActive ; In pass 1 we are walking on the standard path
    jne     .continue ; by trying to hop on the active partition.
xor dh, dh ; Argument for loadBootSector to skip HFS+ partition
; signature check.

    DebugChar('*')
That works just fine :)

I have attached the revised DIFF and also the actual boot0 file that works for me when written to the first 440 bytes of the MBR.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: scrax on February 01, 2010, 10:11:29 AM
Hi to all,
i've added your boot0 to the RC5pre6 version posted by rek at insanely and modded the install script to use dd instead of fdisk. I cant test if it works 'cause i don't have any win installation only osx on my hack so
here you are.
Note that probably you can't select the active volume, DrHurt is working on this problem i think...
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 01, 2010, 08:56:44 PM
Hi to all,
i've added your boot0 to the RC5pre6 version posted by rek at insanely and modded the install script to use dd instead of fdisk. I cant test if it works 'cause i don't have any win installation only osx on my hack so
here you are.
Hi scrax

Thanks for the test installer, but it doesn't work.

When I install boot0 by hand I need to unmount the target HDD, but your installer just runs and says successful. And when I reboot after running your installer, Windows flashes up the error STATUS: 0xc000000e which indicates the MBR has been messed up. This is what happens when I write the unmodified boot0 file, but I see the new boot0 in your installer. So somethings not right..

Note that probably you can't select the active volume, DrHurt is working on this problem i think...
I look forward to see what Dr Hurt comes up with, but I would also like to try the installer that he made where it said it failed because of resource busy..

Thanks

EDIT: I would be happy to try out another version of your installer if you want to supply a revised version :)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: smith@@ on February 04, 2010, 09:18:01 AM
Hi folks and hi rek.

I think I have solved the problem of "resource busy" of boot0. Trying to install from terminal this morning for the first time boot0 amended i stumbled in this error.
I realized after some evidence that the error is due to the mounted disk, trying to unmount the disk error disappears and the installation is successful.
Then I modified the script with the same commands used in the terminal, I've remove the preflight, I recreated the installer and the installation ends perfectly

Code: [Select]
diskutil unmountDisk "$disk" //Added

echo "DDing...."
dd if="${resourcesPath}/boot/boot0" of="$disk" bs=440 count=1 // change from fdisk command
dd if="${resourcesPath}/boot/boot1h" of="$rdev" bs=512 count=2

diskutil mountDisk "$disk" // Added

In attached the package installer with last rc5pre8 and new boot0, it works amazing for me on usb stick.  I need to test on the primary disk.   
What you think?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 04, 2010, 10:21:24 AM
Hi smith@@

This is great, I will have a try this evening when I get back to my hack. :)

I have also been playing with this myself and you're right we can't dd back to the MBR without unmounting the drive first, so I have thought about reading the MBR to file with dd, patching the first 440 bytes in the file, then writing a complete MBR back using fdisk which doesn't require us to unmount the disk.

However, I am no expert at shell scripts so any ideas are welcome..
So far it looks something like this.
Code: [Select]
#! backup the MBR:
echo "Backing up existing MBR....."
sudo dd if=/dev/disk0 of=mbrbackup bs=512 count=1

#! create file to work on:
echo "Creating working file....."
sudo dd if=/dev/disk0 of=mbrhybrid bs=512 count=1

#! write 440 bytes of boot0 in to working file:
echo "Injecting modified code in to working file....."
sudo dd if=boot0 of=mbrhybrid bs=440 count=1

#!write MBR back using fdisk:
echo "Rewriting MBR code....."
fdisk -f mbrhybrid -u -y /dev/rdisk0

echo "Done....."

But note the 'Injection part' needs working on as it needs to just replace the first 440bytes of the MBR leaving the remainder as it was,  where at the moment it writes the 440 bytes only then stops. Maybe there is a shell command to do this properly?

Note: It's only set to disk0 at the moment but with some added logic it can be automated further.

What do you think?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: smith@@ on February 04, 2010, 10:37:54 AM
Hi black, also i like you i'm not expert of shell script, but your idea seems good, and i believe that it works. I think that the result is the same, maybe my way is more simple, maybe but works the same i think.
Fot set the $disk you can use this part of code:

Code: [Select]
targetVolume="$3"                            #  this $3 is the target volume name passed from the installer
....
OF=`mount | grep " on $3 " | awk -F " " '{print $1}'`
....
devprefix=`echo ${OF:0:5}`
devpostfix=`echo ${OF:5}`
diskpostfix=${devpostfix%s*}
dev=`echo $devprefix$devpostfix`
rdev=`echo $devprefix"r"$devpostfix`
disk=`echo $devprefix$diskpostfix`

Hi ;)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 04, 2010, 11:00:39 AM
Hi black, also i like you i'm not expert of shell script, but you idea seems good, and i believe that it works. I think that the result is the same, maybe my way is more simple, maybe but works the same i think.
Thanks for the feedback smith@@

I think either method could work, depending on whether of not you want to unmount the drive.

It can be part of a complete installation package for Chameleon where boot0 is only injected to the first 440 bytes of the MBR. So if there is already a Windows install present, it will leave the existing Windows code intact.

If the user add's Windows7 to a separate partition at a later date, after OS X is already installed. Then just the boot0 needs to be modified. This could be done with an installer, or maybe have the shell script in Rekursor's Pref pane which can be run at the click of a button?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: smith@@ on February 04, 2010, 02:18:23 PM
Thanks for the feedback smith@@

I think either method could work, depending on whether of not you want to unmount the drive.
I can not be more agree ;)  I've do other test and always the boot0 is written correctly, also if from log can read sometimes "failed mounted disk", the boot0 is written perfectly. I have the sensation that the disk in some way be seen like unmounted ;)

It can be part of a complete installation package for Chameleon where boot0 is only injected to the first 440 bytes of the MBR. So if there is already a Windows install present, it will leave the existing Windows code intact.
Sure, you are right ;)

If the user add's Windows7 to a separate partition at a later date, after OS X is already installed. Then just the boot0 needs to be modified.
Like up;)

This could be done with an installer, or maybe have the shell script in Rekursor's Pref pane which can be run at the click of a button?

With a script in Rek panel would be amazing ;)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 04, 2010, 04:25:05 PM
But note the 'Injection part' needs working on as it needs to just replace the first 440bytes of the MBR leaving the remainder as it was,  where at the moment it writes the 440 bytes only then stops. Maybe there is a shell command to do this properly?
Just looking in to this a bit further I have found the command I need to only replace the 440 bytes of the MBR file read to disk, and leave the remainder as it was. It's with the conv=notrunc operand added to the dd command. So the command now reads..
Code: [Select]
#! write 440 bytes of boot0 in to working file:
echo "Injecting modified code in to working file....."
sudo dd if=boot0 of=mbrhybrid bs=440 conv=notrunc count=1
This now works :)

I just need to find time back on my hack to put the code together and test it, then hopefully I'll be a step nearer having a runtime script.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: smith@@ on February 04, 2010, 04:33:49 PM
Ok, i stay tuned for testing  ;)
This could help http://www.icewalkers.com/Linux/ManPages/dd-1.html (http://www.icewalkers.com/Linux/ManPages/dd-1.html)


Thanks for "name"...

Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 04, 2010, 05:49:10 PM
Ok, i stay tuned for testing  ;)
This could help http://www.icewalkers.com/Linux/ManPages/dd-1.html (http://www.icewalkers.com/Linux/ManPages/dd-1.html)
Thanks for the pointer, it's easier to read than from the man command in Terminal :)

Thanks for "name"...
No probs :) (thanks to rocksteady)

UPDATE
Okay, I have to stop for now and this is where I am with it at the moment. I have tested it works, on my PowerMac G5, but not the final fdisk command to write back to the MBR,  I will do that later tonight on my hack. But this should allow you to inject a modified Chameleon boot0 in to your existing MBR without destroying the Windows code already in the MBR and allowing Windows to still be the active partition, and all without having to un-mount your HDD.

If anybody wants to try it, unzip the archive and double-click the InjectMBR.command file.
Only try this if you know what you are doing and have a backup!

EDIT: I have tweaked it to v0.2 but I understand that Zef has taken care of this in the installer code. So I don't think I need to work on this any further. But for the record, I have just tested it out on my system properly and it works :)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: zef on February 05, 2010, 12:21:53 AM
Guys, the fdisk bundled with the binary releases contain a modified fdisk command. We modded it to update only the first 440 bytes in the MBR. You just need to adjust the MBR_CODE_SIZE to 0x1B8.

Get here:

http://www.opensource.apple.com/source/diskdev_cmds/diskdev_cmds-491/fdisk.tproj/mbr.h
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 05, 2010, 09:21:08 AM
Hi Zef, Welcome back.
Lol. That'll teach me to go off on a tangent when you're away ;)

As for the modified boot0 to enable booting from non active partition first, will it be included in the main build on the repo?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 05, 2010, 02:45:18 PM
As for the modified boot0 to enable booting from non active partition first, will it be included in the main build on the repo?

I don't know if this reversed order would be fine in all cases. Let's say I have a HDD with two HFS partitions both installed with boot1h/boot stuff and this modified boot0 in the MBR. In this case boot0 will always prefer the first partition regardless of the active flag set in the MBR. I have a feeling that we can't provide a single boot0 for all possible scenarios. Originally I wanted to alter the default boot sequence as less as possible.

I'm thinking about to provide both versions. This new version could be the default boot0 and the old version could be still bundled as boot0a, where 'a' means 'prefers active partition first'. Or give both versions a unique name to prevent further confusion, then we provide boot0h (prefers bootable hfs first) and boot0a (prefers active first).
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 05, 2010, 03:18:37 PM
I don't know if this reversed order would be fine in all cases. Let's say I have a HDD with two HFS partitions both installed with boot1h/boot stuff and this modified boot0 in the MBR. In this case boot0 will always prefer the first partition regardless of the active flag set in the MBR.
Oh. I never thought about anyone having boot1h installed more than once on the same HDD as surely Chameleon will load any other OS X installations?

I have a feeling that we can't provide a single boot0 for all possible scenarios....
I'm thinking about to provide both versions. This new version could be the default boot0 and the old version could be still bundled as boot0a, where 'a' means 'prefers active partition first'. Or give both versions a unique name to prevent further confusion, then we provide boot0h (prefers bootable hfs first) and boot0a (prefers active first).
I guess you must have faced this scenario before when you original wrote the code? but if one file can't cater for all then I think your idea of providing two individually named boot0 files will make sense.

Sorry if there was any confusion caused with the release of the boot0 that I modified :)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: zef on February 06, 2010, 04:48:13 PM
@Blacksx:

Can you point me to this modded boot0 source please?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: r0m30 on February 06, 2010, 08:50:58 PM
@Blacksx:

Can you point me to this modded boot0 source please?

Blackosx posted the diff here: http://forum.voodooprojects.org/index.php/topic,1141.msg4942.html#msg4942
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: zef on February 06, 2010, 11:32:31 PM
Blackosx posted the diff here: http://forum.voodooprojects.org/index.php/topic,1141.msg4942.html#msg4942

Thx, got it :)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: zef on February 17, 2010, 11:41:40 PM
Guys,

Just added the alternative boot0 using the swapped Pass1<->Pass2 method. You can find the alternate version as boot0hfs.

http://forge.voodooprojects.org/p/chameleon/source/commit/86/

It works for me as expected but it would be great to confirm this from you :)

Thx,
zef
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 18, 2010, 10:49:04 AM
Just added the alternative boot0 using the swapped Pass1<->Pass2 method. You can find the alternate version as boot0hfs.
....
It works for me as expected but it would be great to confirm this from you :)
Hi Zef

Great. I will hopefully try it out tonight and let you know.

EDIT: Dual Boot test

Code: [Select]
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Chameleon               939.5 MB   disk0s2
   3:                  Apple_HFS Macintosh               128.8 GB   disk0s3
   4:       Microsoft Basic Data                         68.7 GB    disk0s4
   5:                  Apple_HFS Backup                  17.2 GB    disk0s5
   6:                  Apple_HFS Vault                   283.8 GB   disk0s6

I have written the boot0hfs file to the first 440bytes of the MBR and done a complete test and can report the boot0hfs file works great, allowing Chameleon to load from a non-active partition. I can then successfully boot Windows7 which is on the active partition and Windows7 sleeps fine. I can also successfully boot OS X from Chameleon.


EDIT 2: HFS only test on my second HDD (Note: I don't have a Windows install on disk1s4 - it's blank)

Code: [Select]
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS Cham                    1.1 GB     disk1s2
   3:                  Apple_HFS SnowLeopard             128.8 GB   disk1s3
   4:       Microsoft Basic Data DISK1S4                 85.9 GB    disk1s4
   5:                  Apple_HFS BackupSL                17.2 GB    disk1s5
   6:                  Apple_HFS Data                    266.4 GB   disk1s6

writing boot0 using 'fdisk -f boot0 -u -y /dev/rdisk1' and rebooting results in a Non-System disk error.
Note: i have tried rev87, rev88 and rev89 and still get the Non-System disk error.

Only writing 'fdisk -f boot0hfs -u -y /dev/rdisk1' boots Chameleon.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 19, 2010, 07:55:22 AM
After some thought I used fdisk to mark my Cham partition active and boot0 now works.
When I was playing with installing Wiindows I must have messed this up.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 19, 2010, 01:56:19 PM
Guys, the fdisk bundled with the binary releases contain a modified fdisk command. We modded it to update only the first 440 bytes in the MBR. You just need to adjust the MBR_CODE_SIZE to 0x1B8.
Hi Zef.

Can you confirm that by using the modded fdisk in the binary release that I only need to enter
fdisk -f boot0hfs -u -y /dev/rdiskX
to write the boot0 code to the first 440 bytes of the MBR leaving the Windows code untouched?

As I am currently still using my method posted here (http://forum.voodooprojects.org/index.php/topic,1141.msg5013.html#msg5013)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 19, 2010, 02:57:23 PM
Can you confirm that by using the modded fdisk in the binary release that I only need to enter
fdisk -f boot0hfs -u -y /dev/rdiskX
to write the boot0 code to the first 440 bytes of the MBR leaving the Windows code untouched?

As I am currently still using my method posted here (http://forum.voodooprojects.org/index.php/topic,1141.msg5013.html#msg5013)

It was fine for Vista, but not tested with 7. Anyway, if your manual dd method alters the first 440 bytes, then this modded fdisk won't touch anything else as well. I'm thinking about to import this modded fdisk into the forge site as fdisk440, then we can prevent any further confusion.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 19, 2010, 03:12:55 PM
I think renaming it 'fdisk440' is a good idea to save confusion and I will try using it this weekend with the boot0hfs instead of my manual dd method.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 19, 2010, 03:57:21 PM
I think renaming it 'fdisk440' is a good idea to save confusion and I will try using it this weekend with the boot0hfs instead of my manual dd method.

Going to setup a test Win 7 + Chameleon combo later today. Be back :)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: zef on February 19, 2010, 05:36:00 PM
Ok,

Just re-applied the patches for the latest fdisk.tproj found in diskdev_cmds-491 (supplied with 10.6.2 sources), and Win7 still survived the MBR code update using this fdisk440.

You can find the modded source here (it contains the very same changes as you get with the Chameleon bundled modified fdisk binary):

http://forge.voodooprojects.org/p/chameleonApplications/source/tree/HEAD/trunk/fdisk.tproj

Build with:

make install

The final binary can be found in:

/tmp/fdisk440/Release/usr/sbin/fdisk440

Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 19, 2010, 05:47:38 PM
Good job Zef.
I will try it this weekend :)
EDIT: Or as soon as I can..
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 19, 2010, 07:38:46 PM
I can confirm fdisk440 works great and doesn't destroy the Windows7 data in the MBR.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 19, 2010, 08:12:54 PM
I can confirm fdisk440 works great and doesn't destroy the Windows7 data in the MBR.

Great :)

When I first read about the failures with Win 7 + Chameleon's boot0, I thought it was something new since the Vista MBR issue and also assumed that everybody uses the bundled modded fdisk and still gets into the well known trouble. We should encourage everybody to update his MBR using this fdisk440 binary.

Attached an universal binary built for 10.5 (works under 10.6 as well):

fdisk440: Mach-O universal binary with 4 architectures
fdisk440 (for architecture ppc7400):   Mach-O executable ppc
fdisk440 (for architecture ppc64):   Mach-O 64-bit executable ppc64
fdisk440 (for architecture i386):     Mach-O executable i386
fdisk440 (for architecture x86_64):   Mach-O 64-bit executable x86_64
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 20, 2010, 10:04:10 AM
I will start advertising this to get the message out.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partition
Post by: Terc on February 22, 2010, 06:21:26 AM
Could this be included with a new installer for the next release? :)

I don't use Windows on real hardware much these days... but it's always good to have options!
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: rocksteady on February 22, 2010, 06:57:00 PM
Yep, just more testing before advertisement guys.

Test-Test-Test-Talk

Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 22, 2010, 11:04:02 PM
Yep, just more testing before advertisement guys.

Test-Test-Test-Talk

This fdisk is bundled since the early Chameleon binaries (1.5+ years), now just renamed to fdisk440 to make this one really unique. Wish it could be tested on a ppc mac.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: rocksteady on February 22, 2010, 11:35:31 PM
heh just joking bout the recent verbalism

(also part of the faq since we were getting a ton of HELPs from people using a standard fdisk/installer)

the rename had to be done :)

black did you try it on your G5?

(don't have time to test anything these days)
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 23, 2010, 09:02:40 AM
I can test fdisk440 later today on my G5. What exactly are we looking for, is it just to see it the binary runs or do you want me to perform any particular command?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 23, 2010, 01:27:19 PM
I can test fdisk440 later today on my G5. What exactly are we looking for, is it just to see it the binary runs or do you want me to perform any particular command?

Can you try updating the MBR code on a spare disk attached to your G5 please?
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: Blackosx on February 23, 2010, 10:13:08 PM
Using my G5 running 10.5.8, I used fdisk440 in write boot0 to a USB memory stick today which boots fine on my hack.

Tomorrow I will take an HDD from my hack that contains OS X and a Windows install, then plug it in to my G5 for writing boot0hfs to with fdisk440. I will post back once completed.

EDIT: Okay I have updated the MBR with boot0hfs, and also written boot1 &2 using my G5 with a HDD from my hack. I will try booting from it later today and report back.

EDIT: Plugged the HDD back in to my hack and both OS X and Windows7 boot fine and Windows7 sleeps.

Conclusion: Success
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: zef on February 25, 2010, 12:02:50 AM
EDIT: Okay I have updated the MBR with boot0hfs, and also written boot1 &2 using my G5 with a HDD from my hack. I will try booting from it later today and report back.

EDIT: Plugged the HDD back in to my hack and both OS X and Windows7 boot fine and Windows7 sleeps.

Conclusion: Success

Very nice! :) Thanks for the report & testing.
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: BuildSmart on April 09, 2010, 06:18:39 AM
zef, here is a self-contained app I've been using to install the boot0hfs (embedded in app) and mark a partition as active [CLICK ME (http://daleenterprise.com/download/flag)].
Title: Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
Post by: staticanime on June 19, 2010, 06:27:36 PM
Guys, quick question, what would I have to change in boot0's first pass to make it look for boot1f32 instead of the standard boot1.

I'm trying out using the EFI partition in it's FAT32 form, but still need to be able to set Windows 7 active. I assume that I need to edit this line in .Pass1:

cmp     BYTE [si + part.type], kPartTypeHFS

But what do I edit it to, I mean, will cmp     BYTE [si + part.type], kPartTypeFAT32 work?