Jump to content

AppleRTC patch (CMOS reset after sleep/wake)

AppleRTC CMOS reset patch

  • Please log in to reply
29 replies to this topic

#1
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,838 posts
  • Gender:Male
  • Location:Brazil
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

 



#2
Micky1979

Micky1979

    I realized that I am lucky

  • Moderators
  • 1,775 posts
  • Gender:Male
  • Location:a 100m dal Tevere, vicino a Peppe

Thanks, just added in Pandora Beta 2  :thumbsup_anim:

All the best!

 

Micky



#3
DiaboliK

DiaboliK

    DiaboliK <- Capital K!

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Hollyweird, CA

This patch does NOT work.



#4
stefano.85

stefano.85

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 231 posts
  • Gender:Male
  • Location:Italy

This patch does NOT work.

 

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...



#5
DiaboliK

DiaboliK

    DiaboliK <- Capital K!

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Hollyweird, CA

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.



#6
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,838 posts
  • Gender:Male
  • Location:Brazil

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.insanelym...ke-in-107-lion/

 

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



#7
DiaboliK

DiaboliK

    DiaboliK <- Capital K!

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,336 posts
  • Gender:Male
  • Location:Hollyweird, CA
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)
        }
    }
}


#8
oldnapalm

oldnapalm

    InsanelyMac V.I.P.

  • Moderators
  • 6,838 posts
  • Gender:Male
  • Location:Brazil

On my Asus P5E this DSDT patch only fixes CMOS reset if I don't use sleep. After a sleep/wake CMOS is still reset if I don't patch AppleRTC.



#9
Marchrius

Marchrius

    Lo scippatore di emozioni

  • Pandora Team
  • 319 posts
  • Gender:Male
  • Location:Ferrara, Italia
  • Interests:Studente di Informatica.
    Passione/Hobby: Informatica in generale, hackintosh, musica Rock...

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

 

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



#10
saschamt

saschamt

    InsanelyMac Protégé

  • Members
  • Pip
  • 12 posts

Is this the same with DP5?



#11
holyfield

holyfield

    InsanelyMac Protégé

  • Members
  • PipPip
  • 93 posts
  • Gender:Male
  • Location:Europe

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?

 

 

 

 

 



#12
vol264

vol264

    InsanelyMac Protégé

  • Members
  • Pip
  • 39 posts

Hi,

 

After applying this patch (perl script) shutdown and restart do not work as described here:

 

http://www.insanelym...m-on-mavericks/



#13
rgviva

rgviva

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts

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



#14
Romker

Romker

    InsanelyMac Protégé

  • Members
  • Pip
  • 15 posts
  • Gender:Male
  • Location:Moscow, Zimbabve

Patch worked. Tnx!



#15
MacNB

MacNB

    InsanelyMac Protégé

  • Members
  • PipPip
  • 69 posts
  • Gender:Male


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 ##### 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.



#16
oSxFr33k

oSxFr33k

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 824 posts
  • Gender:Male
  • Interests:Sound and Graphic Design. Electronics in general.

Will this same patch work in 10.9.1 or its no longer needed?



#17
JorgeMax

JorgeMax

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 275 posts
  • Gender:Male
  • Location:Brasil-Piauí-Teresina

Attached File  Captura de Tela 2014-02-14 s 08.24.31.png   38.21KB   7 downloads

 

Friends. I did a "dump" of the RTC, the Eurotherm DarwinDumper. Can you tell me, why he reported "bugs" in the CMOS reset? 
 
There may be errors in my system after the "sleep"?


#18
djperryprada

djperryprada

    InsanelyMac Protégé

  • Members
  • Pip
  • 2 posts
  • Gender:Male

 can some body  help me and patch my rtc kext its failing   some times it goes to the wheel to restart  other times just  resets my cmos right away  but prob is its causing a cmos reset n i have the patch kext installed  



#19
rgviva

rgviva

    InsanelyMac Protégé

  • Members
  • Pip
  • 6 posts

Just apply the patch above (which i mention in prev comment). You will no longer have RTC/cmos errors. Verify md5 before patching.



#20
Onixs

Onixs

    Since 2007

  • Members
  • PipPipPipPipPipPipPip
  • 747 posts
  • Gender:Male

Just apply the patch above (which i mention in prev comment). You will no longer have RTC/cmos errors. Verify md5 before patching.

could you specify which build. 10.9.?







Also tagged with one or more of these keywords: AppleRTC, CMOS reset, patch


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy