Mac OS X Development Development and discussion on the latest hackintosh drivers and methods.

Reply
 
Thread Tools Display Modes
  (#11) Old
mechdrew mechdrew is offline
Super Moderator
 
mechdrew's Avatar
 
Posts: 1,356
Join Date: Jan 2009
Location: Idaho
Send a message via AIM to mechdrew
Default 01-01-2010, 06:11 PM

Quote:
Originally Posted by Scooter70 View Post
Thanks for this info. I kept having to go re-format and re-make my install drive every time the Repair killed it. I also figured out that you can make the BCD files on your USB drive read-only so that repair can't mess with them.
Haha, yeah I tried that. I put my Win7 Installer on a SD card, so it has the little lock switch for read-only. I've never been successful with it yet, I think it still wants to write the file to it and gives up without trying the actual installation on the hard drive. Who knows, maybe I just did it wrong. Great idea, though, if anyone has any luck with it be sure to post!


Dell Mini 10v | Mac OS X 10.6.2 | XP Home | Windows 7 Home | 2GB RAM | 160GB HDD | BIOS A05 | USB Legacy: ON | USB Wake: ON | BT: None | NBI 0.8.3 Final
http://osx.mechdrew.com - News and Guides for Installing Mac OS X via NetbookInstaller - Now on Twitter

Reply With Quote
  (#12) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-06-2010, 06:37 AM

I believe that I may have figured out why installing Chameleon with NBI breaks booting Windows 7 until you do a repair. When NBI writes Chameleon's boot0 to the MBR, I believe it overwrites the entire 512-byte MBR, including the 4-byte disk signature area. When Windows can't find the disk signature it wrote, it refuses to boot. The solution would seem to be not to touch the disk signature. In fact, as discussed here, the official Chameleon binary package includes a modified fdisk that keeps the Windows disk signature intact. It seems to me that NBI should use it for the install (or just manually work around the 4 bytes). I am pretty sure this will solve this issue. Next time I run NBI and reinstall Chameleon, I will dump the (pre-repair) MBR using dd then verify the disk signature bytes are NULL. I will also try using dd to rewrite my currently working (post-repair) MBR (which I have already saved with dd) and see if that gets Windows booting again without doing the repair.

On a somewhat related note, while looking into this issue, I came across a simple Chameleon patch that allows Windows 7 hibernation and sleep to work with Chameleon (see Reply #16 by hb76). Using hb76's instructions, I have successfully in place edited the following byte (in red) of the MBR (which is actually just the installed copy of Chameleon's boot0):
0x060: c6 04 00 b3 01 80 ff 01 75 0a 80 3c 80 75 0f 30
to
0x060: c6 04 00 b3 01 80 ff 01 75 0a 80 3c 68 75 0f 30
(This should only be attempted by advanced users that have a way to recover from a corrupted MBR, which can render a system inoperable. Try this at your own risk!).

I used HxD in Windows (it worked just fine despite hb76's warning). In OS X, iBored should also work. More advanced users could even just use dd to write the byte change. Needless to say, I think this patch should ultimately be added to Chameleon (NBI version, if not mainline as discussed in the patch thread--has not happened as of RC4). With this small change, one can multi-boot with Chameleon, Windows will hibernate and sleep properly, and OS X will still boot normally (except possibly in the unusual case where the first HFS+ partition on the disk is not the Mac boot partition).

[EDIT - Forgot to add (though it is in hb76's detailed instructions,) that after doing the byte-patch you have to set the Windows partition to be active in order for hibernation to work in Win 7.]


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
  (#13) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-08-2010, 06:17 AM

Looking at the source code for NBI, it indeed uses the standard OS X fdisk tool to update the MBR with Chameleon's boot0. As noted in its man page, the OS X fdisk "will overwrite the NT disk signature, if present." I am pretty sure this is what causes Windows 7 to fail to boot post-Chameleon install until the repair procedure is performed. This problem can seemingly be easily fixed in NBI by bundling and using (from the ramdisk) the fdisk binary supplied with the official Chameleon package, as that fdisk has been modified to retain the NT disk signature.


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
  (#14) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-10-2010, 11:07 PM

I made a backup of /usr/sbin/fdisk and replaced it with the fdisk that is supplied in the official Chameleon RC4 binary package. This forces NBI to use a fixed fdisk binary that does not overwrite the Windows disk signature. After running NBI 0.83 final with the "Install bootloader" option checked, I can confirm that I am still able to dual-boot with Windows. No need to go through the tedious repair process.

Unless and until meklort updates NBI to include and use the fixed fdisk binary, dual-boot users should consider replacing the stock fdisk with the Chameleon-supplied one so that NBI may be used without worry of breaking dual-boot...


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
  (#15) Old
Scooter70 Scooter70 is offline
Senior Member
 
Posts: 112
Join Date: Jul 2009
Location: Metro Detroit
Default 01-12-2010, 02:10 AM

Great news minimalpc. Where might we find the fixed fdisk binary? Is it just a matter of backing up the current file and putting the new one on its place?


-=|| Mini10v | 2GB | 120GB | BT | Win7 Pro | OSX 10.6.2 ||=-
Reply With Quote
  (#16) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-12-2010, 02:47 AM

Quote:
Originally Posted by Scooter70 View Post
Great news minimalpc. Where might we find the fixed fdisk binary?
It is included with official Chameleon releases, which can be found here. Specifically, it is in the "i386" directory of the binary package (i.e. the latest, Chameleon-2.0-RC4-r684-bin.tar.gz).

Quote:
Is it just a matter of backing up the current file and putting the new one on its place?
Yep, just to be safe you might need to set permissions on the new fdisk once you put it in place. I.e., "sudo chown root:wheel /usr/sbin/fdisk" and "sudo chmod 755 /usr/sbin/fdisk".


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
  (#17) Old
Scooter70 Scooter70 is offline
Senior Member
 
Posts: 112
Join Date: Jul 2009
Location: Metro Detroit
Default 01-12-2010, 02:30 PM

Thanks. I'll report back when I get a chance to try it out. I haven't updated to NBI 8.3 Final yet so I'll use this opportunity to do it and prove out your fix.


-=|| Mini10v | 2GB | 120GB | BT | Win7 Pro | OSX 10.6.2 ||=-
Reply With Quote
  (#18) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-13-2010, 12:43 AM

Quote:
Originally Posted by Scooter70 View Post
Thanks. I'll report back when I get a chance to try it out. I haven't updated to NBI 8.3 Final yet so I'll use this opportunity to do it and prove out your fix.
If you decide to try the other fix I posted above (the ones that makes hibernate work in Windows 7), you'll want to do that after running NBI. Otherwise, NBI will just overwrite your change if you check the box to reinstall the bootloader--i.e. Chameleon.

Alternatively, if you are comfortable doing so, you could just modify the "boot0" file included in the NBI .app package using the same byte-patch I described above. The boot0 file is what ends up getting written to the MBR when NBI installs Chameleon. This would save you from having to modify the MBR itself later.


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
  (#19) Old
Scooter70 Scooter70 is offline
Senior Member
 
Posts: 112
Join Date: Jul 2009
Location: Metro Detroit
Default 01-13-2010, 05:53 PM

I swapped in the new fdisk and ran NBI 0.8.3 Final and my Mini rebooted as it should. Woo hoo!

I'm using EasyBCD instead of Chameleon so hibernate works for me in Windows7. (At least I think that's why it works.)
Reply With Quote
  (#20) Old
minimalpc minimalpc is offline
Expert Member
 
Posts: 560
Join Date: Dec 2009
Default 01-13-2010, 11:57 PM

Quote:
Originally Posted by Scooter70 View Post
I swapped in the new fdisk and ran NBI 0.8.3 Final and my Mini rebooted as it should. Woo hoo!

I'm using EasyBCD instead of Chameleon so hibernate works for me in Windows7. (At least I think that's why it works.)
For hibernate to work properly in Windows 7, its partition must be the active one. Normally, since only one partition can be active at a time, this means you cannot use Chameleon as your bootloader because the MBR it installs looks for the first active partition then tries to boot it. If the Windows 7 partition is active, it ends up booting straight into Windows, bypassing the Chameleon boot menu (which is installed on the Mac partition). The patch I posted above changes the MBR code to look for the first Mac (HFS+) partition then boot from it, which will get you to the Chameleon boot menu even though the WIndows 7 partition is active.

Since you are using EasyBCD, I presume that your Windows 7 partition is active, so hibernate works. That said, I believe you can just uncheck the "Install bootloader" box when you run NBI--you don't need Chameleon since you have EasyBCD. No need for you to replace fdisk at all as that is only necessary because installing Chameleon overwrites the Windows disk signature in the MBR.


Dell Mini 10v | Mac OS X 10.6.2 | Windows 7 Professional | Ubuntu Netbook Remix 9.10 | 1GB RAM | 160GB HDD | BIOS A05 | USB Legacy: OFF | USB Wake: OFF | BT: Enabled (self-installed BCM2046) | NBI 0.8.3 final
Reply With Quote
Reply

« Previous Thread | Next Thread »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright © 2008-2016 MyDellMini.com.