Jump to content

AppleRTC patch (CMOS reset after sleep/wake)


oldnapalm
 Share

48 posts in this topic

Recommended Posts

sudo perl -pi -e 's|\x75\x2e\x0f\xb6|\xeb\x2e\x0f\xb6|' /System/Library/Extensions/AppleRTC.kext/Contents/MacOS/AppleRTC
sudo touch /System/Library/Extensions
 

It's the same patch as ML, just different location, thanks rayap
 
 
10.8
< 0000000000001d32 jne 0x1d64
---
> 0000000000001d32 jmp 0x1d64
10.9
< 0000000000000d3e jne 0xd6e
---
> 0000000000000d3e jmp 0xd6e

 

  • Like 13
Link to comment
Share on other sites

For me it worked pretty well! i've patched the original applertc from S/L/E and added in E/E , then i've restored the vanilla one in the original S/L/E folder...

 

well without a patched dsdt on 4 different machines that ive tested this on, cmos resets until i patch the dsdt, so.... i can confirm that it doesnt work.

Link to comment
Share on other sites

Without a patched DSDT you will have CMOS reset even without using sleep/wake on many machines.

 

AppleRTC patch avoids CMOS reset after sleep/wake.

 

It's a well known issue, anyway I've updated the title.

 

More info

http://www.insanelymac.com/forum/topic/253992-cmos-resets-on-restarts-after-sleep-and-wake-in-107-lion/

 

If it's not the case, how do you patch DSDT to avoid CMOS reset after sleep/wake?

  • Like 1
Link to comment
Share on other sites

If it's not the case, how do you patch DSDT to avoid CMOS reset after sleep/wake?

 

Original code with comments on what to change.

Device (RTC)
{
    Name (_HID, EisaId ("PNP0B00"))  // _HID: Hardware ID
    Name (ATT0, ResourceTemplate ()
    {
        IO (Decode16,
            0x0070,             // Range Minimum
            0x0070,             // Range Maximum
            0x00,               // Alignment
            0x04,               // Length <-- Change from 4 to 2
            )
        IRQNoFlags () // <-- remove or comment 
            {8} // <-- these two lines
    })
    Name (ATT1, ResourceTemplate ()
    {
        IO (Decode16,
            0x0070,             // Range Minimum
            0x0070,             // Range Maximum
            0x00,               // Alignment
            0x04,               // Length <-- Change from 4 to 2
            )
    })
    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
    {
        If (LGreaterEqual (OSFX, 0x03)) {
            If (HPTF) {
                Return (ATT1)
            } Else {
                Return (ATT0)
            }
        } Else {
            Return (ATT0)
        }
    }
}

Fixed without comments:

Device (RTC)
{
    Name (_HID, EisaId ("PNP0B00"))  // _HID: Hardware ID
    Name (ATT0, ResourceTemplate ()
    {
        IO (Decode16,
            0x0070,             // Range Minimum
            0x0070,             // Range Maximum
            0x00,               // Alignment
            0x02,               // Length
            )
    })
    Name (ATT1, ResourceTemplate ()
    {
        IO (Decode16,
            0x0070,             // Range Minimum
            0x0070,             // Range Maximum
            0x00,               // Alignment
            0x02,               // Length
            )
    })
    Method (_CRS, 0, NotSerialized)  // _CRS: Current Resource Settings
    {
        If (LGreaterEqual (OSFX, 0x03)) {
            If (HPTF) {
                Return (ATT1)
            } Else {
                Return (ATT0)
            }
        } Else {
            Return (ATT0)
        }
    }
}
Link to comment
Share on other sites

AppleRTC in DP2 can be patched with the same offset from the DP1

 

EDIT: Sorry, my mistake. Is the same kext. :P

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

oldnapalm, thank you for nice tip.

 

 

I have on my DSTD the RTC block:

                Device (RTC)
                {
                    Name (_HID, EisaId ("PNP0B00"))
                    Name (BUF0, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x01,               // Alignment
                            0x02,               // Length
                            )
                    })
                    Name (BUF1, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0070,             // Range Minimum
                            0x0070,             // Range Maximum
                            0x01,               // Alignment
                            0x08,               // Length
                            )
                        IRQNoFlags ()
                            {8}
                    })
                    Method (_CRS, 0, Serialized)
                    {
                        If (LEqual (HPTS, One))
                        {
                            Return (BUF0)
                        }
                        Else
                        {
                            Return (BUF1)
                        }
                    }
                }

If I remove the IRQNoFlags (), then comp will not go to the sleep at all. Has been reported that erasing IRQ from RTC breaks sleep under snow leopard 10.6.0 and 10.6.1, on 10.6.2 doesn´t breaks sleep. Seems that OS X 10.9 (13A603) removing the IRQNoFlags will break the sleep. 

 

I tested your suggestion to patch AppleRTC. Similar approach is also described on thedotnetter blog. 

 

Seems that this patch does NOT work for me. Any suggestions?

 

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

This works for me on 10.9 Mavericks:

perl -pi -e 's|\x41\x89\xd7\x41\x89\xf4|\xe9\xb8\x00\x00\x00\x90|;' /System/Library/Extensions/AppleRTC.kext/Contents/MacOS/AppleRTC

 

Verify your source file before patching: 

md5 AppleRTC 

MD5 (AppleRTC) = 4b1d28ac48a2a7b35ed6b2034e0fd912

 

This patch completely disables all CMOS writes from AppleRTC

Link to comment
Share on other sites

  • 2 weeks later...

This works for me on 10.9 Mavericks:

perl -pi -e 's|\x41\x89\xd7\x41\x89\xf4|\xe9\xb8\x00\x00\x00\x90|;' /System/Library/Extensions/AppleRTC.kext/Contents/MacOS/AppleRTC

 

Verify your source file before patching: 

md5 AppleRTC 

MD5 (AppleRTC) = 4b1d28ac48a2a7b35ed6b2034e0fd912

 

This patch completely disables all CMOS writes from AppleRTC

This patch worked for me on my Dell Inspiron 530 running 10.9. The one that [url=&quot;http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/&quot;]#####[/url] 6 installed does not work for me - after restart, the cmos is corrupt (even after shutdown - sometimes).

But after 4 restarts & shutdowns, all seems OK.

Thx.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
  • 4 weeks later...
  • 2 weeks later...
@windowsX1
joust the first time zone in mac OSX. 
then in windows. 
Even in windows add this file to the registry. 
After that restart switching between windows and mac about 3 times
to synchronize the system and voila, you are done, you will see that your time will be the same in both systems.
credits:iddpioneer

 

Corrigir_Horario_Win_Mac.zip

Link to comment
Share on other sites

Im use the patch for ML and always after from shutdown or restart  when im starting windows my clock is 3 hrs back!  How to fix that.

 

I have windows & mac in same hdd.

You may install BootCamp on Windows. (reading HFS+ partitions is a benefit)

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

I have recently updated my system to Mavericks, and now if the system sleeps the CMOS is corrupted. I realise looking through some threads here that this is pretty old news, but I had a DSDT file in Mountain Lion which I guess took care of this issue (came via a Kakewalk install), so it wasn't a problem for me. Now in Mavericks I don't have a DSDT file. (I used MyHack.) 

As I am new to this topic any guidance is welcome:

 

1. Can I use an off-the-shelf DSDT.aml file for my motherboard or do I need to compile one myself somehow? If so, how?

2. Once I have a DSDT.aml file, will adding the patch above solve my problem?

 

My system: a venerable GA-EX58-UD5, 2.7GHz Intel Core i7, GeForce 9800 GT 512MB, 6GB Corsair memory. Still going strong after a number of years.

Extras installed: just what came with MyHack, namely:

 

AppleACPIPS2Nub.kext

ApplePS2Controller.kext

FakeSMC.kext

lspcidrv.kext

NullCPUPowerManagement.kext

Patched_10.7_AppleRTC.kext

 

As a side note, my boot up time since upgrading is very long - about 2mins to the login screen, another long while before I can actually log in. Fine once in. Is a DSDT file likely to help with this issue?

 

Thanks.

Link to comment
Share on other sites

 Share

×
×
  • Create New...