overdue-scratch

Author Topic: Removing the requirement for Chameleon (boot1h/boot) to be on active partition  (Read 50689 times)

0 Members and 2 Guests are viewing this topic.

smith@@

  • Member
  • Posts: 49
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #15 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


Thanks for "name"...

« Last Edit: February 04, 2010, 04:38:04 PM by smith@@ »

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #16 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
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 :)
« Last Edit: February 04, 2010, 10:12:26 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

zef

  • Administrator
  • Posts: 265
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
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #18 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?
« Last Edit: February 05, 2010, 10:29:34 AM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

zef

  • Administrator
  • Posts: 265
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #19 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).
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #20 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 :)
« Last Edit: February 05, 2010, 05:59:09 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

zef

  • Administrator
  • Posts: 265
@Blacksx:

Can you point me to this modded boot0 source please?
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

r0m30

  • Forum Moderator
  • Posts: 98
    • r0m30's OSX86 site
@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
--- r0m30 ---
HP Mini 1033CL (Costco) OSX Retail 10.6 Chameleon-2.0-RC3-r658
HP m9077c -  ASUS IPIBL-LA MoBo with Core 2 Quad Q6600
    Retail 10.6.2 Chameleon-2.0-RC4-r684

zef

  • Administrator
  • Posts: 265
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

zef

  • Administrator
  • Posts: 265
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
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #25 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.
« Last Edit: February 18, 2010, 11:14:47 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #26 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.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #27 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
« Last Edit: February 19, 2010, 01:58:27 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB

zef

  • Administrator
  • Posts: 265
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #28 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

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.
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

Blackosx

  • Forum Moderator
  • Posts: 1150
Re: Removing the requirement for Chameleon (boot1h/boot) to be on active partit
« Reply #29 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.
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB