Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
Feb 18, 2011
Messages
78
Motherboard
ProBook 4340s B6L98EA
CPU
i5 2450m
Graphics
Intel HD 3000
Mobile Phone
  1. Android
How to patch DSDT for working battery status

Make sure you keep up with the updates if you're using Clover as Clover (and PBI-Clover Edition) is subject to a bit more churn.

Thank you for your answer. Can you please explain what did you mean? "...is subject to a bit more churn" ? First time I follow the classic PBI guide and setup Mavericks properly. But I don't remember what was the battery status behavior. Then I migrate to clover as described in migration from Chameleon to Clover guide. In this moment I've noticed on battery status problem. Only if I check and uncheck the Show percentage in menu the percentage refreshed and tell me the capacity percent. But as for Time remaining - it never shows as expected.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,623
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
How to patch DSDT for working battery status

Thank you for your answer. Can you please explain what did you mean? "...is subject to a bit more churn" ? First time I follow the classic PBI guide and setup Mavericks properly. But I don't remember what was the battery status behavior. Then I migrate to clover as described in migration from Chameleon to Clover guide. In this moment I've noticed on battery status problem. Only if I check and uncheck the Show percentage in menu the percentage refreshed and tell me the capacity percent. But as for Time remaining - it never shows as expected.

Churn == changes. There is a lot of ongoing/recent changes to Clover...
 
Joined
Nov 13, 2013
Messages
62
Motherboard
OS X 10.9.5
CPU
intel core 2 duo T6570
Graphics
Nvidia Geforce G 105m
Mac
Classic Mac
Mobile Phone
How to patch DSDT for working battery status

Hi, Mr Rehabman. :)

Does the iasl version 20140724 also has the same problem like version 20140627 ?

If does, have you already made a modified version ?
 
Joined
Jul 6, 2014
Messages
6
Motherboard
Asus G2S
CPU
Core2Duo T7700/PM965
Graphics
GeForce 8600M GT, 1920x1200
Mac
Classic Mac
Mobile Phone
How to patch DSDT for working battery status

Hi RehabMan,

I've patched my DSDT according to post #1 manually and also applied "Fix Mutex with non-zero SyncLevel" patch, but it still shows 0% battery.

Can you please take a look at my DSDT?

Thanks!
 

Attachments

  • DSDT.zip
    18.5 KB · Views: 79
Joined
Feb 18, 2011
Messages
78
Motherboard
ProBook 4340s B6L98EA
CPU
i5 2450m
Graphics
Intel HD 3000
Mobile Phone
  1. Android
How to patch DSDT for working battery status

Churn == changes. There is a lot of ongoing/recent changes to Clover...

I've installed Coconut battery, that shows the proper percentage, but i saw that some other parameters is wrong. Please See attachment. I've found that after full change in sleep mode i power on laptop, all parameters is good and stock osx battery shows the right percentage, but when i reboot, i saw attached picture.

Can you please help me and point where i can search for a problem?

Thanks a lot!
 

Attachments

  • Screen Shot 2014-07-26 at 10.15.56.png
    Screen Shot 2014-07-26 at 10.15.56.png
    88.8 KB · Views: 104
  • Screen Shot 2014-07-26 at 10.23.49.png
    Screen Shot 2014-07-26 at 10.23.49.png
    211.1 KB · Views: 122

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,623
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
How to patch DSDT for working battery status

Hi RehabMan,

I've patched my DSDT according to post #1 manually and also applied "Fix Mutex with non-zero SyncLevel" patch, but it still shows 0% battery.

Can you please take a look at my DSDT?

Thanks!

The DSDT you uploaded appears to be unpatched or incompletely patched...
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,623
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
How to patch DSDT for working battery status

I've installed Coconut battery, that shows the proper percentage, but i saw that some other parameters is wrong. Please See attachment. I've found that after full change in sleep mode i power on laptop, all parameters is good and stock osx battery shows the right percentage, but when i reboot, i saw attached picture.

Can you please help me and point where i can search for a problem?

Thanks a lot!

What, exactly, is wrong?
 
Joined
Jul 6, 2014
Messages
6
Motherboard
Asus G2S
CPU
Core2Duo T7700/PM965
Graphics
GeForce 8600M GT, 1920x1200
Mac
Classic Mac
Mobile Phone
How to patch DSDT for working battery status

The DSDT you uploaded appears to be unpatched or incompletely patched...

I've patched Field ECOR, which in your example is ECF2. If I understand correctly, I have to modify only those bigger than 8 and is defined in other places. Those below that are still 16 is just defined here.

Then I replaced each instance of the old variable (for example TAH0) with this:

Code:
Store (B1B2(AH00,AH01), Local0)

Actually, all variables I changed are used in
Code:
Store (VARIABLE, Local0)

To finish up I've added B1B2 method and applied Mutex patch, is there anything I missed?

Code:
OperationRegion (ECOR, EmbeddedControl, Zero, 0xFF)            
Field (ECOR, ByteAcc, Lock, Preserve)
            {
                Offset (0x04), 
                CMD1,   8, 
                CDT1,   8, 
                CDT2,   8, 
                CDT3,   8, 
                Offset (0x80), 
                EPWS,   8, 
                EB0S,   8, 
                EB1S,   8, 
                EB0R,   8, 
                EB1R,   8, 
                EPWF,   8, 
                Offset (0x87), 
                EB0T,   8, 
                EB1T,   8, 
                Offset (0x8A), 
                HKEN,   1, 
                Offset (0x93), 
               [COLOR=#ff0000][B] // was TAH0, 16
                AH00,   8,
                AH01,   8,
                // end TAH0[/B]
                [B]// was TAH1, 16 
                AH10,   8,
                AH11,   8,
                // end TAH1 [/B][/COLOR]
                TSTP,   8, 
                Offset (0x9C), 
                CDT4,   8, 
                CDT5,   8, 
                Offset (0xA0), 
                ECPU,   8, 
                ECRT,   8, 
                EPSV,   8, 
                EACT,   8, 
                TH1R,   8, 
                TH1L,   8, 
                TH0R,   8, 
                TH0L,   8, 
                Offset (0xB0),
                B0PN,   16,
               [COLOR=#ff0000][B] // was B0VL, 16 
                VL00,   8,
                VL01,   8,
                // end B0VL[/B]
                [B]// was B0RC, 16 
                RC00,   8,
                RC01,   8,
                // end B0RC[/B]
               [B] // was B0FC, 16 
                FC00,   8,
                FC01,   8,
                // end B0FC[/B]
                [B]// was B0MD 
                MD00,   8,
                MD01,   8,
                // end B0MD[/B]
                [B]// was B0ST, 16 
                ST00,   8,
                ST01,   8,
                // end B0ST[/B]
                [B]// was B0CC, 16 
                CC00,   8,
                CC01,   8,
                // end B0CC [/B][/COLOR]
                B0TM,   16,
                B0C1,   16,
                B0C2,   16,   
                B0C3,   16, 
                B0C4,   16, 
                Offset (0xD0), 
                B1PN,   16, 
                [COLOR=#ff0000][B]// was B1VL,   16,
                VL10,   8,
                VL11,   8,
                // end B1VL [/B]
                [B]// was B1RC,   16, 
                RC10,   8,
                RC11,   8,
                // end B1RC
                // was B1FC,   16, 
                FC10,   8,
                FC11,   8,
                // end B1FC
                // was B1MD,   16, 
                MD10,   8,
                MD11,   8,
                // end B1MD
                // was B1ST,   16, 
                ST10,   8,
                ST11,   8,
                // end B1ST
                // was B1CC,   16,
                CC10,   8,
                CC11,   8,
                // end B1CC[/B][/COLOR]
                B1TM,   16, 
                B1C1,   16, 
                B1C2,   16, 
                B1C3,   16, 
                B1C4,   16, 
                Offset (0xF0), 
               [COLOR=#ff0000][B] // was B0DC,   16, 
                DC00,   8,
                DC01,   8,
                // end B0DC
                // was B0DV,   16, 
                DV00,   8,
                DV01,   8,
                // end B0DV
                // was B0SN,   16, 
                SN00,   8,
                SN01,   8,
                // end B0SN[/B][/COLOR]
                Offset (0xF8), 
               [COLOR=#ff0000][B] // was B1DC,   16,
                DC10,   8,
                DC11,   8,
                // end B1DC
                // was B1DV,   16,
                DV10,   8,
                DV11,   8,
                // end B1DV
                // was B1SN,   16 
                SN10,   8,
                SN11,   8
                // end B1SN[/B][/COLOR]
            }
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,623
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
How to patch DSDT for working battery status

Hi, Mr Rehabman. :)

Does the iasl version 20140724 also has the same problem like version 20140627 ?

If does, have you already made a modified version ?

If you are referring to new changes made by Intel, I pull every-so-often from their repo to update my own. I expect the issue with their current builds will persist as it is a "feature."

My repo: https://github.com/RehabMan/acpica
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
184,623
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
How to patch DSDT for working battery status

I've patched Field ECOR, which in your example is ECF2. If I understand correctly, I have to modify only those bigger than 8 and is defined in other places.

You have to patch all EmbeddedControl fields that are accessed by the code and larger than 8-bit. Your DSDT has several Field definitions in EC...

Code:
            OperationRegion (ECOR, EmbeddedControl, Zero, 0xFF)
...

            OperationRegion (SMBX, EmbeddedControl, 0x18, 0x28)
...

            OperationRegion (SMB2, EmbeddedControl, 0x40, 0x28)
...
            OperationRegion (NSBS, EmbeddedControl, 0x40, 0x04)
...

So... after finding all the EC regions and their names (ECOR, SMBX, SMB2, NSBS), you then search for all the fields within...



Code:
            Field (ECOR, ByteAcc, Lock, Preserve)
            {
                // many >8 bit in here...
... 

            Field (SMBX, ByteAcc, NoLock, Preserve)
            {
...
                BDAT,   256, 

...
            Field (SMBX, ByteAcc, NoLock, Preserve)
            {
                        Offset (0x04), 
                DT2B,   16
            }
...
            OperationRegion (SMB2, EmbeddedControl, 0x40, 0x28)
            Field (SMB2, ByteAcc, NoLock, Preserve)
            {
...
                BDA2,   256,

Have fun...
 
Top