Jump to content

CMOS Resets on Restarts after Sleep and Wake in 10.7 (Lion)


rayap
 Share

474 posts in this topic

Recommended Posts

Amended 24th day of June, 2011

 

On Lion DP1-4 installations, after using sleep and wake in the system normally, BIOS reports CMOS Checksum Error on reboot or boot after shutdown. It seems that the new AppleRTC.kext v1.4 added functionatality is causing this Error.

 

Initially, a workaround suggested by JUN Ho is to use the AppleRTC.kext from SnowLeopard

 

Then by blocking a few jumps and calls in the procedures of AppleRTC.kext, the Checksum Error was overcome. It appears APPLE has left in-situ much of their realtime testing code in this kext and these modifications do not apparently affect their basic functionatility in normal cases.

On further investigation by tseug and with the assistance of his DumpCMOS.kext , an updated patch (post# 217) was prepared by blackosx. This patch for vanilla AppleRTC.kext is effective on the latest build 11A494a. (besides also on recent builds)

 

This solution will not affect those osx86 setups which inherently have Sleep or Wake problems. However, it will overcome the CMOS Checksum Error caused by RTC register length of 0x04 or 0x08 in DSDT and eliminate log msg RTC: Only single RAM bank (128 bytes) if, when a RTC register length of 0x02 is used.

 

Added 2nd day of July, 2011

New patch for AppleRTC.kext of Lion GM - Build 11A511 by tseug (Post #248). The binary patch now, is a single unconditional jump for each arch to bypass Checksum changes.

 

Added 10th day of July, 2011

An alternate patch for AppleRTC.kext of Lion GM. (Post # 340)

The only way for my Asus P6TSE and P5QPRO MBs in Lion GM to correct this CMOS reset error after Sleep/Wake is

1. Install ElliottForceLegacyRTC.kext in /S/L/E

2. Disable Legacy USB support in BIOS and use PS2 keyboard instead

 

So maybe someone can figure out how to modify USB settings in DSDT to solve it.

Link to comment
Share on other sites

Anyone still working on this? =/

Been trying a few of my own undocumented DSDT experiments... Every single one I still get CMOS reset. I did manage to fix the reboot/black screen I used to get with unpatched AppleRTC.kext 1.4 on wake, not too sure what fixed it but the last thing I remember changing was alignment in Device (RTC) to 1, as posted by cartri.

 

And I ran into a strange message on wake in kernel.log:

 

Aug 11 13:48:11 Mac-Pro kernel[0]: Wake reason: RTC UHC6 (Alarm)

Aug 11 13:48:11 Mac-Pro kernel[0]: RTC: maintenance alarm 2011/8/11 14:48:02, sleep 2011/8/11 12:48:05

Aug 11 13:48:11 Mac-Pro kernel[0]: The USB device BCM2046B1 (Port 2 of Hub at 0x5a000000) may have caused a wake by issuing a remote wakeup (2)

 

RTC maintenance alarm? :S Not seen that before myself :withstupid:

 

Specs in sig...

Link to comment
Share on other sites

Thanks to all who worked on this!

 

Running the latest patch on AppleRTC fixed my sleep problem. GA-P35-DS3L Rev 2.0 with a DSDT created from DSDT Auto-Patcher.

 

Thank you!

TQ for sharing with us your solution to sleep'

Which latest patch on AppleRTC are you referring to?

Would appreciate if you can list the patch code or where it come from?

Thank You

Link to comment
Share on other sites

  • 2 weeks later...
I can confirm that AppleRTC.kext 1.3.1 from 10.6.8 works with 10.7/10.7.1 and takes care of the CMOS issue on my z68X-UDH3-B3 with a DSDT installed.

 

 

A patched AppleRTC.kext or vanilla? I have to try this on my GA-Z68X-UD4-B3

 

 

 

Edited Next Day:

 

NO CMOS reset with next 10.6.8. However I do get an additional message that I do not get with 10.7.1 kext.

 

 

Graphics suppressed 7984 ms

 

 

10.6.8 and 10.7.1 have same message upon wake USB3/Firewire/Airport disconnect. I am not sure if the USB3 disconnects or just resets? For sure the Firewire and Airport do.

 

 

PXHCD    ResetControllerState - reseting saved status for 4 root hub ports
PXHCD    ResetControllerState - reseting saved status for 4 root hub ports
AirPort: Link Down on en0. Reason 8 (Disassociated because station leaving).
        0 [Time 1314809940] [Message Wake reason: ethernet EHC1 (Network)
no card!
no card!
AppleFWOHCI_AsyncReceive::waitForDMA - context not going inactive.
AppleFWOHCI_AsyncReceive::waitForDMA - context not going inactive.
FireWire GUID ffffffffffffffff is invalid!
      0        0 AppleUSBCDC: start - initDevice failed
      0        0 AppleUSBCDC: start - initDevice failed
Graphics suppressed 7984 ms
FireWire GUID ffffffffffffffff is invalid!
HID tickle 12915 ms
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!
FireWire GUID ffffffffffffffff is invalid!

Link to comment
Share on other sites

  • 2 weeks later...
I can confirm that AppleRTC.kext 1.3.1 from 10.6.8 works with 10.7/10.7.1 and takes care of the CMOS issue on my z68X-UDH3-B3 with a DSDT installed.

 

Hello,

 

I have a Z68X-UD3H-B3+MSI 9850 Cyclone+16Gb RAM. I have a perfectly working Snow Leopard in one partition (sleeps working flawlessly except autosleep). I then had a try installing Lion on a separate partition, following tonymacx86 xMove method.

 

Under Lion I was experiencing the expected CMOS reset and sleep not working (blank screen, fans and LEDs on)

 

I then patch Lion AppleRTC like this

 

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

 

Now CMOS reset is gone. But sleep is not yet quite working. I can sleep the machine once. Upon awakening, I loose the USB keyboard (Apple Aluminum wired keyboard) no matter which USB port it is attached to. Also, the machine sleeps only once, the second time an further it just blank the screen with LEDs and fans on.

 

Am I missing the addition of any Kexts? I am using a DSDT patched from my system under Snow Leopard with Mald0n's DSTDPatcher and I have the following kexts under /Extra/Extensions:

ACPIMonitor.kext

FakeSMC.kext

IOAHCIBlockStorageInjector.kext

IntelCPUMonitor.kext

NVClockX.kext

RadeonMonitor.kext

SuperIOFamily.kext

 

Besides that, just the installation of Realtek drivers under /System.

 

Any clues? No sleep is a dealbreaker to me.

Link to comment
Share on other sites

After sleep the system didn't wake up, force restart and the verbose message stop here:

"RTC: Only single RAM bank (128 bytes)"

 

The same DSDT works well for the Snow Leopard, it looks the same issue as this thread reported, my question is how I can apply the perl fix when I can not login? Any advice is appreciated.

 

>Update: I have figured what's the problem, I'm using a PS2 keyboard, it seems I need disable the USB keyboard and USB mouse in the BIOS. After I did that, it start working again.

Link to comment
Share on other sites

Hello there everyone!

 

I have successfully installed Lion with everything working just fine, except this problem: I can't shut it down completely. After I click the shut down button, it closes everything and it shuts down, but after 5 seconds or so it starts again. The LED of my power button keeps blinking in that interval. The only way too shut it down is just to keep the power button pressed after it starts again.

 

Appreciate all the work guys, without you none of this would be possible. If anyone can help me, I would gladly accept it.

 

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...

Hi guys,

 

I'm using rayap's (thanks!) one-liner from post #340 to binpatch AppleRTC.

 

In the ever quest for vanilla, just got another crazy idea...

 

How about recalculating the checksum in the DSDT (either in _PTS or _GTS) ?

 

What do you think ?

Link to comment
Share on other sites

How do I even wake it from sleep? i tried hitting the keys and also moving the mouse...?

Check your DSDT; get help in that thread.

Also, is it a big deal that it resets CMOS? What exactly does it mean?

Watch a PC boot, if there is no BIOS error(see topic title) - no need for this CMOS fix.

Link to comment
Share on other sites

Hey lnx2mac - Good job with all your work on the revised network driver, and I read you'll be releasing the source soon. Great.

How about recalculating the checksum in the DSDT (either in _PTS or _GTS) ?

Fixing the RTC issue from ACPI does look possible as per RevoGirl's post from July (below), but I've not found the time or had the patience to look deeper at it, though to be honest I easily get lost when working with the finer details of ACPI coding. Maybe your skills could develop the idea further?

 

read the ACPI specification 4.0 and specifically chapter 15.

 

There you’ll read that method _GTS is executed after method _PTS when your system is going to sleep, and there’s also _BFS which is executed upon waking, and thus before method _WAK is executed.

 

The first method would be the place to read and store the RTC data, and method _BFS to restore it, when required. Just give it a shot.

 

You can also block writes to address 56h-59h in the RAM banks, by changing the RTC configuration register. This way it will ignore writes to the addresses. And yes. Everything can be done from the ACPI namespace… and I would use a tiny SSDT for this (see RevoBoot WiKi) but the boot loader is probably the best place to make changes to the RTC configuration register

 

Good luck trying!

 

Oh, and as STLVNUB and OonihiloO, I didn't have to re-patch the AppleRTC binary either after updating to 10.7.2

Link to comment
Share on other sites

I can confirm too :

AppleRTC.kext is still with version 1.4

The patch can still be used and is still working (tested on X58A-UD3R rev 2)

Enjoy

 

Could you please post the patched AppleRTC.kext that works on X58A-UD3R rev 2?

 

I have the same MB and had AppleRTC.kext patch that use to work (no CMOS rest and perfect sleep) since May.

On Wednesday, I had a problem with iCloud and had to reinstall Lion and use latest version of Chimera.

Very same patched AppleRTC.kext is now working only partially: no CMOS reset but the system does not wake from sleep!?

Also tried to patch new AppleRTC.kext which comes with 10.7.2 using script from message #340 - the same, partial (un)success.

Interestingly enough, I have the same issue on another Gigabyte MB - X58-UD7!?

 

Any help or hint how to get my good night and Hackintosh sleeps back is highly appreciated.

 

 

Edit: The things are even worse than I initially thought! Even Shut Down causes CMOS reset. The only thing that works is Reset?

 

EDIT 2: SOLVED THE PROBLEM !!!

It had nothing to do with Chimera or 10.7.2 update!

Realtek Gigabit Ethernet driver 2.0.6 for 81xx Ethernet controllers is the culprit!!! :(

As soon as I removed it, everything went to normal with old patched AppleRTC.kext.

Link to comment
Share on other sites

Hi guys,

 

I'm using rayap's (thanks!) one-liner from post #340 to binpatch AppleRTC.

 

In the ever quest for vanilla, just got another crazy idea...

 

How about recalculating the checksum in the DSDT (either in _PTS or _GTS) ?

 

What do you think ?

 

Code in DSDT is not allowed to modify the CMOS so I don't think that will work (although I don't know enough about the DSDT to understand the details of what you're saying). I did try to make a recalculation kext a while back and hook it up to the sleep event but I was unable to make it run after the modification had been made - only before.

Link to comment
Share on other sites

 Share

×
×
  • Create New...