Voodooprojects

Chameleon => Bug Reports => Topic started by: Kasakka on June 26, 2009, 07:52:35 PM

Title: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Kasakka on June 26, 2009, 07:52:35 PM
I stumbled upon a strange problem: Chameleon v2.0RC1 prevents my Windows 7 from going to sleep!

I've got two hard drives, one has OSX 10.5.7 with Chameleon 2.0RC1 and another that has Windows 7 RC 64-bit on it. If I boot with Chameleon and then boot into Windows by selecting the System Reserved (boot partition for Win7) partition and when Win7 has started try to put it to sleep, it either comes back from sleep instantly or it shuts off the displays but fans stay running, power LED on and so on and won't wake up.

If I use a different bootloader (tested with the Xiafyhyhhr whatever found on iAtkos v7 disc) then sleep works normally in Windows. Likewise if I change the hard drive boot order from BIOS to boot first from Win7 disk, sleep works as it should.

I've also got the sleep problem in OSX. It shows exact same symptoms as Win7 w/ Chameleon 2.0 except it always goes into the "fans running, power LED on, no wake up" mode. For the record OSX sleep does not work with a different bootloader but I didn't get to try it with the default darwin bootloader because iAtkos v7 doesn't seem to be able to install it and I don't know how to do it manually.

So I'm guessing something in Chameleon is preventing sleep from working on my system?

System:
Abit IP35 (P35, ICH9R)
Core2Quad Q9550
4GB DDR2-800
2x Samsung SATA HDD (1TB and 500GB, OSX installed on 500GB drive)
1x DVDRW (SATA)
GTX260 896 MB (using EFI string and EVGA drivers)
Echo AudioFire 4 FW audio interface (so no VoodooHDA needed)
Title: Re: Chameleon 2.0RC1 prevents sleep - on Windows!
Post by: Snow on June 27, 2009, 07:50:11 AM
Same here,

Sleep (S3) worked before with previous Chameleon but obviously I had to F8 in BIOS to get my boot HD's and select the windows drive to go into windows (without messing with bootloader files etc)

Chameleon 2 is fantastic but it brakes sleep mode in Windows 7 x64 (b7229)

Leopard 10.5.7 seems to work fine though so it's a Windows/chameleon compability issue only.

Windows logs off and thats it, all energy settings remained the same before /after Chameleon install.

Please some help with this issue because this might turn me back to the old chameleon if that is even still possible .

Thx in advance lads

Some sys specs:

DS3P / Q6600 / 4GB / Samsung SATA DVDRW / 3 SATA drives (Leo 10.5.7 Vanilla/default boot drive, Win 7 and Storage) / 8800GT / Audigy 2 ZS


Title: Re: Chameleon 2.0RC1 prevents sleep - on Windows!
Post by: Snow on June 30, 2009, 07:49:17 AM
Any news on this?

Thx
Title: Re: Chameleon 2.0RC1 prevents sleep - on Windows!
Post by: Kasakka on July 26, 2009, 08:51:39 PM
This problem still persists in RC2.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: eyvind on August 04, 2009, 12:52:34 PM
I have exactly the same problem here  :-\

Before, deep sleep worked on both OSX and windows... now OSX doesnt go into deepsleep (this worked before).
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: macgeek on August 07, 2009, 03:50:20 AM
Help!  I'm having the same problem with Windows 7 x64 RTM.  When I had RC1 of Chameleon, everything worked fine.

Leopard won't sleep either, the display goes off and the computer gets stuck with all fans spinning, etc.

I would like to get my sleep working again.  I use it all the time.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: quinielascom on August 08, 2009, 03:24:29 AM
When i try to put Windows 7 x86 RTM Ultimate to sleep, it comes back from sleep instantly but only if Windows is NOT the active partition:

With Chameleon 2.0 RCx: Sleep Fail
With GRUB (without makeactive option): Sleep Fail
With GRUB & set makeactive: Sleep Works.
With "Windows 7 loader": Sleep Works

Then, i think that Active/Not Active flag in the partition/hard drive is the trouble.

Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: eyvind on August 08, 2009, 05:24:59 AM
Hmm... Interesting idea... I'll test that now :)

If only there was a way to make the windows partition active, then boot the chameleon partition. THe problem is that if you do this, when you select windows from the chameleon menu, you get an endless loop...

Maybe its possible to install chameleon the system partition windows 7 creates ? But this defeats the purpose of an invisible extra partition (efi partition)
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Gringo Vermelho on August 08, 2009, 06:13:16 PM
I don't understand how it can be possible for Chameleon to affect an OS that's installed on a separate hard drive, specially because you're not even using Chameleon to boot that drive. Sounds more like behavior of a virus than that of a boot loader.

Try unplugging the drive that has Chameleon on it and do a CMOS reset, don't forget to re-set your BIOS settings.

Then boot Windows 7 and try putting it to sleep.

Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: macgeek on August 08, 2009, 08:23:57 PM
I have Windows 7 and Leopard installed on 1 HD.  Flagging the 2nd partition (windows), Windows sleeps perfectly. Flag 1st partition (chameleon bootloader) neither OS sleeps. RC 1 was fine when it came to sleeping.  RC 2 broke sleep.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: spongemak on October 27, 2009, 10:24:46 PM
I found the solution for this problem, I upgraded my vista with windows 7 and had no issues with chameleon and sleep, however I did a clean install of windows 7 and started to have this problem, I found the solution is disabling hibernate or hibryd sleep in windows 7.

To disable Hibernate in command prompt, type powercfg -h off and press enter.

I guess Windows tries to use hibryd sleep or hibernate with the active or boot partition, and that cuases the problem, also makes windows unstable.

This problem has nothing to do with chameleon, is a problem from windows and leopard by it self, if you are having problems with leopard probably is some driver o your dsdt.aml
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: thunderclap82 on October 31, 2009, 05:21:02 PM
I don't understand how it can be possible for Chameleon to affect an OS that's installed on a separate hard drive, specially because you're not even using Chameleon to boot that drive. Sounds more like behavior of a virus than that of a boot loader.

It is strange that Chameleon could be causing problems but it does.  I've encountered several problems because of Chameleon in fact, nothing that couldn't be worked around though.  (I have Chameleon 2.0 RC3 installed.)  The three problems I had were resolved by changing the boot drive from the Chameleon drive (Snow Leopard) to the Windows drive thereby bypassing Chameleon.  The problems I had:

1.) I couldn't upgrade Windows Vista to Windows 7.  Every time I tried I received an error message that a folder couldn't be created.  As soon as I changed the BIOS to boot Windows exclusively I didn't receive an error.

2.) Windows 7 wouldn't go to sleep.  Bypassing Chameleon let the computer go to sleep without incident.  (I did resolve the issue using Spongemak's recommendation.)

3.) I tried registering my system for the beta of a new game in development.  The web site scans the system hardware, and when it did this I kept receiving an error that the system couldn't be scanned.  Again, changing the BIOS boot order to bypass Chameleon resolved the issue.

I don't know how or why Chameleon causes these minor issues (and they are minor) but by bypassing Chameleon I think it does demonstrate it is something with Chameleon causing the problem.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: hb76 on November 21, 2009, 12:06:15 AM
My config:
Chameleon 2.0RC3 - BIOS Booted
One Disk - MBR synced to GPT:
EFI System Partition
MacOS 10.6.2
Windows 7

boot0 in MBR
boot1h in MacOS partition

What I found out:

boot0 tries to find active partition in MBR
if found, it loads the boot code of this partition an executes it
if there is no active partition, it searches for an HFS+ partition
as far as I can tell from the boot0 assembler code, it makes also
use of the GPT for this step. If found, it executes the boot code.

So if Windows is active, the boot1h is never executed and Windows is booted
directly.

On the other hand: If the active partition contains boot1h (= MacOS partition) then
one can choose to boot Windows from boot1h, but the Windows system partition is not active.

Unfortunatly, Windows 7 needs its system partition to be active for a couple of things.
That are:
1a. BCDEDIT does not know where its config is (can be overcome by /store C:\BOOT\BCD)
1b. Tools as easyBCD dont work either
1c. and of course the boot priority settings dont work either
2. Hibernation does not work because it wants to write to the active partition
3. Sleep mode does not work because the default is "Hybrid-Sleep" which is a combination of Standby and Hibernation (this can be overcome by turning Hybrid-Sleep off in the advanced power settings)


The only thing to fix this IMHO is to let boot0 ignore active partitions and search for boot1h
in a different way.

Maybe one could make a boot1h ID like this (pseudo ASM):
jmp .start
data magic number
.start

and let boot0 search for the magic number on all MBR partitions, ignoring the active flag.

(for a single HFS partition on the disk this is almost built into boot0 already, you have just
to disable the search for an active partition UNTESTET)

So.
Now I'd like to hear some feedback.


Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: hb76 on November 21, 2009, 03:52:57 PM
SOLVED !!!

I disabled the lookup for the active partition in boot0.

Now the Windows partition can be active AND boot0 finds the boot1h partition via GUID.

Sleep, BCDEDIT and hibernation works (in Windows 7).


Edit: I will provide detailed instructions soon.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Blackosx on November 21, 2009, 11:22:20 PM
I don't really understand exactly how you have done this, but well done as I have found it a pain that Windows 7 won't sleep when using a modified booter. :)
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: staticanime on November 22, 2009, 02:55:05 AM
I don't really understand exactly how you have done this, but well done as I have found it a pain that Windows 7 won't sleep when using a modified booter. :)
So what, you boot up, and get the Chameleon bootloader, even though the Windows disk is active? If so, can you give us instructions on how you achieved this, I'd like to do the same
Title: SOLVED Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: hb76 on November 22, 2009, 05:16:26 PM
I do not have a clean solution yet, so you still have to wait some time.

In the meantime the most brave among you might want to tryout this procedure:

WARNING: This might break your Chameleon Installation / MBR / GPT
I think it should work if you have only one win7 and one HFS+ partition on your primary disk.
The disk must be partitioned with GUID partition table.
Try at your own risk.

1. Save your master boot record
dd if=/dev/rdriveX of=<fileMBR> bs=512 count=1
and if you have time, also save the GPT (the first 16kB of your disk should be enough)
dd if=/dev/rdriveX of=<fileMBR-GPT> bs=512 count=32

make sure that you still can access this file even if neither OsX nor Windows can boot (e.g. save on an USB stick)

2. download the binary Chameleon2 RC3 package

3. copy the boot0 file to boot0-win7fix

4. Now we are going to change the boot0win7 MBR code
echo h > not0x80
dd if=not0x80 of=boot0win7 bs=1 seek=108 conv=notrunc count=1


5. verify that everything worked !!!
This should be done, but you can skip this step if you dont have developer tools on your OsX
ndisasm boot0 > boot0.asm
ndisasm boot0win7 > boot0win7.asm
diff -u boot0.asm boot0win7.asm


This should give something like this:
-0000006A  803C80            cmp byte [si],0x80
+0000006A  803C68            cmp byte [si],0x68


this is the code where boot0 checks if a partition is bootable (0x80). By changing this
boot0 will not find an active partition and will try to check for an HFS+ partition in the GPT tables.

6. Good: When you are done, you can write boot0win7 to the MBR with fdisk (this will however delete the diskID and
you have to use the win7 DVD to repair)
Better: use dd to write only the first 440bytes of to the MBR (I did this with Linux dd)
BAD: !!! do not write the whole file with dd to the MBR - this will delete your MBR partition table !!!

7a. boot Windows and set its partition to active, then check sleep an hibernation
7b. If everything fails, get a linux live CD and rewrite the MBR backup of step 1.

For the advanced user:
(One could also take the MBR from step 1. instead of the boot0 from Chameleon distro)

I KNOW THIS IS A REALLY BAD FIX, BUT:
1. This is exactly how I did it on my computer in the first place
2. I don't want to add bad code to the source code
3. I'm still working on a proper fix (see attached file for proposed changes)


Edit: I found an easier way to do this:

1. download a disk editor that can access raw disks
(e.g. HDD software Free Neo http://www.hhdsoftware.com/ for windows
 HxD did not work because its not 64bit safe )
2. open your disk
3. Change the following line
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

Edit2: corrected some typos

Edit3: I would apreciate feedback (especially on the patch for boot0.s)
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: staticanime on November 23, 2009, 01:29:00 AM
Just tried your fix there, the face says it all -> ;D

I patched boot0 with the echo h > not0x80 and the following dd command, then installed it with fdisk in mac os x, set my windows partition active, and repaired windows 7, now have hibernate and hybrid sleep working.

PS this is on a GPT/MBR hybrid, with Chameleon on the EFi partition, Snow Leopard on the 2nd partition, ubuntu 9.10 on the 3rd, and Windows 7 on the 4th
Title: Re: SOLVED Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: zef on November 23, 2009, 12:48:37 PM
I would apreciate feedback (especially on the patch for boot0.s)

Hi hb76,

Nice finding! :) If I understand correctly Win7 is picky about what partition is set active and sleep/hibernate works only if his partition is the active one. Your change overrides Chameleon's boot0 ability to pickup the active partition on hybrid GPT/MBR disks.

Originally this behaviour was meant to be a cool feature, but it seems it causes more headaches instead of happiness for win7 users - in case you want to use Chameleon as the primary boot loader. I can live without it and left the MBR untouched then boot my Mac OS partition via Vista's BCD + chain0 (added by EasyBCD) method.

What we can do is to either remove this feature forever or provide a separate version of boot0, one with the original extra hybrid GPT/MBR active partition scan and another one with this different functionality.

Bye,
zef
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: hb76 on November 23, 2009, 07:46:29 PM
I  suggest to remove the search for an active MBR partition on GPT/PMBR systems in the next release candidate.

Maybe one could make a comment to the source why it has been removed.

If people start complaining after the release, one could add a second boot0.

wkr

hb76

BTW: I did not even know about the chain0/BDCedit multiboot path. I am kind of a newbie to Chameleon and stuff.


Edit:  I searched the web and found dozens of threads asking for a solution to this problem. So
in my opinion it should be the default behaviour to ignore the active partition in a PMBR (while still using it when there is no GPT).
 
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Artmuzz on November 28, 2009, 11:57:46 AM
Thanks spongemak :)

I have Snow Leopard and Windows 7 dual booting with Chameleon 2 RC3.

Your solution fixed my problem of Windows 7 not going into sleep mode. I went into CMD as administrator and typed "powercfg -h off" and pressed enter and closed CMD window. I now have sleep working. ;D

Cheers

Art
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Blackosx on December 02, 2009, 03:39:35 PM
Good work hb76. Thanks for spending the time to detail your solution for us all :)
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: minimalpc on January 05, 2010, 04:18:55 AM
It doesn't look like this fix made it into RC4.  Are there still plans to incorporate it into a future version?

BTW, hb76, I am not sure about the proposed ASM patch, but the one-byte change you posted above works great!  I had no problems using HxD to make the change (doesn't look like the free HHD Neo supports disk editing).  Thanks for all your work on this!
Title: Re: SOLVED Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: staticanime on January 15, 2010, 04:29:13 PM
I tried your patch for boot0.s, unforunantly, it didn't do anything at all, Chameleon still honoured my active partitino flag first. I can confirm tho that the one byte edit works, just wish I could de-compile boot0 after the one byte patch so I could make a diff for it. Here's hoping you get a working patch soon (^_^)

redundant quoting trimmed.
Title: Re: SOLVED Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: minimalpc on January 20, 2010, 01:02:04 AM
I tried your patch for boot0.s, unforunantly, it didn't do anything at all, Chameleon still honoured my active partitino flag first. I can confirm tho that the one byte edit works, just wish I could de-compile boot0 after the one byte patch so I could make a diff for it. Here's hoping you get a working patch soon (^_^)

The quick and dirty one byte patch just effectively results in the following change to the ASM code in boot0.s:
Code: [Select]
.Pass1:
    cmp     BYTE [si + part.bootid], kPartActive ; In pass 1 we are walking on the standard path
becomes
Code: [Select]
.Pass1:
    cmp     BYTE [si + part.bootid], 0x68 ; In pass 1 we are walking on the standard path

However, I believe all that does is make Pass1 fail eventually so that it moves onto Pass2.  In that case, a more efficient way of changing the code would be to just get rid of Pass1.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: cirial on March 05, 2010, 02:50:51 PM
The hexedit solution does work.. Win7 is set as active partition, and Chameleon still boots. Sleep and Hibernate work in Win7 for me on my Lenovo S10 netbook. Im using a GUID partition scheme, OSX installed first on second partition, win7 on primary partition and a 3rd shared partition just for space.

However, my computer doesnt goto sleep, THEN hibernate after X amount of minutes like it did when I only had Win7 on here. It just sleeps and sleeps and sleeps.  Truely seems like all my settings are correct. Like I said.. hibernate at least works now, but just not fully the way it used to.

Any suggestions? Can you other guys that got this working help out and let me know if your laptops/netbooks do this?
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Gringo Vermelho on March 05, 2010, 03:34:57 PM
You want "Hybrid Sleep".

Is it enabled in your Windows 7 power management profile?
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: cirial on March 05, 2010, 04:14:38 PM
Nope, I will enable it and check back..
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: cirial on March 05, 2010, 07:53:03 PM
No luck using the "hybrid sleep" option.  I had that enabled, and have "hibernate after.. on battery" on 1 minute. It just sleeps and sleeps. Never goes to hibernate automatically.

Also, hybrid sleep is NOT the answer to this hibernation problem.  Hybrid sleep sleeps just like the regular sleep setting does, but it ALSO saves to hard disk like a hibernation.  From what I have seen on my Lenovo netbook is that resuming from hybrid sleep is extremely slow and hd intensive. It took 5+ min to get back to windows.

I just want my "hibernate after" setting to work correctly.
Title: Re: Chameleon 2.0RC1 and RC2 prevents sleep - on Windows!
Post by: Skorpio_72 on August 07, 2014, 04:20:47 PM
I found the solution for this problem, I upgraded my vista with windows 7 and had no issues with chameleon and sleep, however I did a clean install of windows 7 and started to have this problem, I found the solution is disabling hibernate or hibryd sleep in windows 7.

To disable Hibernate in command prompt, type powercfg -h off and press enter.

I guess Windows tries to use hibryd sleep or hibernate with the active or boot partition, and that cuases the problem, also makes windows unstable.

This problem has nothing to do with chameleon, is a problem from windows and leopard by it self, if you are having problems with leopard probably is some driver o your dsdt.aml

THANK YOU!!!!
This solution is always been under my nose but i've never seen it; it has solved my needs, easily and with no efforts at all ;)