Getting Lion to Sleep

My college friend, a zookeeper in St. Louis, confirmed my theory that nobody has really ever had trouble convincing a lion to sleep; it’s essentially all lions do.  In fact, in captivity, they sleep an average of 13.5 hours of the 24-hour day!


That said, as I mentioned in my post regarding my first impressions of OSx86 Lion, this little kitty’s sleep schedule was an issue right off-the-bat; it became an even bigger problem when we received our electric bill after a month of sleepless nights.

The Problem

Lion would sleep.  It would even wake from sleep– and even better than that, it would wake from sleep with a simple double-click of the (bluetooth) mouse, a commodity not afforded to me whilst running Snow Leopard on the ol’ hackintosh.  The problem arose when rebooting the machine anytime after I put it to sleep: CMOS would reset, indicating a checksum error.  My overclock settings would be lost (I’d have to load them from a saved BIOS configuration), necessitating a second reboot.  Kind of like when I crash hard at about 10:00 AM the day after taking Benadryl before I go to sleep.

The Solution

The dedicated folks at tackled the problem with gusto (as always!) and determined that the AppleRTC.kext was once again to blame (it’s an old foe, if you didn’t know…).  The thread dedicated to this issue is long, but the good news is that the problem can be fixed with a simple terminal command that patches the AppleRTC.kext in /System/Library/Extensions.  I recommend making a copy of the kext before applying the patch.

Note:  You need to have a working DSDT.aml in order for sleep to work at all (at least with Gigabyte motherboards).

Here is the code to run in Terminal:

sudo perl -pi -e 's|\x75\x30\x44\x89\xf8|\xeb\x30\x44\x89\xf8|;
s|\x75\x3d\x8b\x75\x08|\xeb\x3d\x8b\x75\x08|' /System/Library/Extensions/AppleRTC.kext/Contents/MacOS/AppleRTC

Follow it up with these commands that fix permissions on the newly-patched AppleRTC.kext (actually, on the entire /System/Library/Extensions directory):

sudo chown -R 0:0 /System/Library/Extensions
sudo chmod -R 755 /System/Library/Extensions

Voila!  Reboot (so OS X can load the new kernel extension) and put your hackintosh to sleep.  Wake ‘er up and reboot to test whether or not the patch worked.

As a side note, I had  kernel panic when I tried to sleep my machine for the first time.  It pointed to a couple of USB kernel extensions as the cause, so I turned on the Chameleon “USB Fix: option and rebooted.  I’ll do some more research on whether or not the USB drivers actually caused the panic or if it was random (perhaps my iPhone was syncing when I tried to put my box to sleep or something– I know it was connected).  The second try worked like a charm.

As always, thanks to the community for their hard work, specifically BlackOSX.  Job well done!

12 thoughts on “Getting Lion to Sleep

  1. HI, i am sorry I have been trying to figure ut the sleep fix, (Chameleon “USB Fix: option) is that in the chameleon settings?

  2. Hi great post.

    I recently was trying to fix the sleep/wake issue on my hackintosh, but got stucked. I Have the same motherboard as yours, p35-ds3l, different video card — I have a Sapphire Radeon HD5770. Running 10.7.2, everything is good except wake up.

    After the machine sleeps properly, when it is woke up by keyboard or power button, it goes to black screen directly. The power is on, fans spinning, but no output to screen. I tried to ping it from another machine, but no response. Clearly the NIC was not brought up either.

    I’ve tried many ways according to insanelymac, but none of them works. Have you seen anything similar? Any suggestion?

    Thanks a lot!

  3. I’m extremely pleased to uncover this web site. I wanted to thank you for your time just for this wonderful read!! I definitely appreciated every part of it and i also have you bookmarked to check out new information in your web site.

  4. Pingback: Chloe

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s