Jump to content

[Guide] Laptop Battery Indicator - The DSDT Patching Horror


Recommended Posts

Posted
On 1/1/2019 at 2:02 AM, onemanosx said:

Actualización 3 de enero de 2019

Excellent tutorial, in my case I have a DSDT created by Mald0n a long time ago, but I have the problem that the battery of 100% that is shown in the bar, does not decrease, staying frozen with that percentage, some solution please.

Posted

Hi guys, I have a perfect Catalina installation on my HP Laptop (check sign) thanks to a patched DSDT by @MaLd0n.

Using OpenCore, all is working great (PM, Sleep/Wake, USB, QI/QE, WiFi and Bt). Also battery seems to work as it should do...but I only use VirtualSMC and battery plugin.

Checking my DSDT I found some integer larger than 8 bit... and moreover I have either H_EC and EC, and I don't know which to watch. Using SSDTTime, a message alert me that only EC is used... but is it true?

Right now icon and percentage are working fine, charge and discharge, residual charge,... all is working as expected on a real MacBook.

I'm confused... I don't if should be useful trying to patch this few integer I found, or I can leave them in place (and live in peace..)

This is my DSDT... Please can someone help me?

DSDT.aml.zip

  • Administrators
Posted
11 hours ago, stalvatero said:

Hi guys

hey

in ur case is ec0 and i think u used ec0 to ec acpi patch rename

device EC is there

wqU65nr.png

ignore H_EC device in this case

-Guides and Tutorials HERE

-Hackintosh Tutorial Database - HERE

-The largest EFI folder collection for Hackintosh HERE

-Support Olarila Vanilla Hackintosh by making a donation HERE

-Professional Hackintosh Support since 2006 HERE

Posted
5 hours ago, MaLd0n said:

in ur case is ec0 and i think u used ec0 to ec acpi patch rename

Well no, I haven't any ACPI rename patch. Battery seems to works OOB with only VoodooSCM and battery plugin.

Anyway, in DSDT EC, under EmbeddedController I have these part of code:

OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)
            Field (ERAM, ByteAcc, Lock, Preserve)
            {
                Offset (0x5A), 
                Offset (0x5B), 
                Offset (0x5C), 
                Offset (0x5D), 
                ENIB,   16, 
                ENDD,   8, 
                SMPR,   8, 
                SMST,   8, 
                SMAD,   8, 
                SMCM,   8, 
                SMD0,   256, 
                BCNT,   8, 
                SMAA,   24, 
                SMBN,   8, 
                Offset (0x8A)
            }

but only SMD0 is called up down EC region, and

OperationRegion (ECRM, EmbeddedControl, Zero, 0xFF)
            Field (ECRM, ByteAcc, Lock, Preserve)
            {
                Offset (0x5D), 
                ERIB,   16, 
                ERBD,   8, 
                Offset (0xAA), 
                Offset (0xAB), 
                Offset (0xAD), 
                    ,   4, 
                Offset (0xAE), 
                PTVL,   4, 
                Offset (0xB0), 
                Offset (0xB1), 
                Offset (0xB2), 
                Offset (0xB3), 
                Offset (0xB4), 
                Offset (0xB5), 
                Offset (0xBC), 
                Offset (0xBD)
            }

but only ERIB is called up down EC region.

So, as far as I understood by this tutorial, I should patch SMD0 find in:

spacer.png

So, first...

Remane that SMD0... 

into device label EC code_regex (SMD0,)\s+(256) replace_matched begin SMDX,%2,//%1%2 end;

But trying to compile, I receive no errors. So it means that nothing is accessing to this SMD0, so no need to patch it, right? Or I'm not receiving errors because SMD0 is also present in H_EC??

So I leave SMD0 in place without renaming it.

Now go to ERIB integer.

Following the tutorial in OP, it's ok to rename ERIB

into device label EC code_regex ERIB,\s+16, replace_matched begin RIB0,8,RIB1,8, end;

but I don't know how to continue because I only have ERIB = Arg0 in two methods right below the Operation region. The tutorials do not cover this case, so Idk what to do.

spacer.png

 

Any help?

  • Administrators
Posted

if work with virtual smc stay with native things

 

virtualsmc emulate it, is not like acpibatterymanager

  • Thanks 1

-Guides and Tutorials HERE

-Hackintosh Tutorial Database - HERE

-The largest EFI folder collection for Hackintosh HERE

-Support Olarila Vanilla Hackintosh by making a donation HERE

-Professional Hackintosh Support since 2006 HERE

Posted

I have that problem, I have read our friend's @onemanosx guide and also with rehabman's guide to patch the battery, using the DSDT that my friend Damn patched, but I'm confused with something, many things in the guide I don't appreciate in my dsdt.

hi @MaLd0n you patched my dsdt but left me a hotpach of the EC, that does not create a conflict when trying to patch the battery at the dsdt level? and there is no way to remove that hotpach.

With the rehabman guide I did everything, but with the virtualsmc the indicator works but there comes a time that the kernel_task process goes through the roof, which using the fakesmc does not happen, but the indicator stays frozen when I disconnect or connect the charger, He updates the indicator when I put the laptop to sleep.

I migrated from catalina to bigsur, I also migrated from clover to opencore, I have learned a lot in this forum, I only have the problem of the loader, if they guide me to patch it we can create a thread to have the advance.

 

Build

CPU: AMD Ryzen 5 3600

MOTHERBOARD: ASUS TUF GAMING X570-PLUS

RAM: CORSAIR VENGEANCE RGB PRO 16 GB 2X8 3200 MHZ

VIDEO: XFX RX 580 4 GB

AUDIO: Realtek ALC1200A

  • Administrators
Posted
4 hours ago, cedroxim said:

I have that problem

use ssdts or dsdt

dsdt is full solution

ssdt is not full but some people using it and stay happy

-Guides and Tutorials HERE

-Hackintosh Tutorial Database - HERE

-The largest EFI folder collection for Hackintosh HERE

-Support Olarila Vanilla Hackintosh by making a donation HERE

-Professional Hackintosh Support since 2006 HERE

Posted (edited)

               Offset (0x12), 
                FUSL,   8,  0x12
                FUSH,   8,  0x13
                FWBT,   64,  `0x14`
                
                Offset (0x5D), 
                EXSI,   8,  0x5D
                EXSB,   8, 0x5E
                EXND,   8, 0x5F
                SMPR,   8,  0x60
                SMST,   8,  0x61
                SMAD,   8,  0x62
                SMCM,   8,  0x63
                SMDA,   256,  `0x64`
                BCNT,   8, 
                SMAA,   8, 
                SAD0,   8, 
                SAD1,   8, 
                
                Offset (0x8F), 
                BMN0,   72,  0x8F
                BDN0,   64,  0x98

 

have I calculated it right?

how do I calculate the last one?

edit: calculated the last one correct?

DSDT.aml

Edited by rajuchacharuk
Posted (edited)

@onemanosx

I agree with you about the offset except it doesn't work that way according to this example Rehabman told me I was wrong.

My DSDT example

   Field (ECF2, ByteAcc, Lock, Preserve)
                    {
                        Offset (0x10),
                        BDN0,   56,          //0x10
                        Offset (0x18),
                        BME0,   8,           //0x18
                        Offset (0x20),
                        BMNC,   8,          //0x20
                        BMN0,   120,      //0x21
                        BCT0,   128,      //0x2F    <<<<  If I go by your way of calculating this should be 0x30
                        Offset (0x70),
                        BCCL,   8,
                        IDGS,   16,
                        Offset (0x7E),

The example you used on the first post looks like this is the way to calculate it.  But from what I see you use 0x20 converted to (32) in decimal each time plus only the previous field bits divided by 8.  Maybe it was pure coincidence it happed to work out that way in your example but it certainly does not work with my example above, unless Rehabman just happen to have a brain fart that day he replied to me?

Rehabman's reply to me:

Quote from Rehabman:

Wrong. BCT0 is at offset 0x2f (0x20 + (120/8)).

 

Edited:

Rehabman must be wrong because if what he is saying is true in my DSDT example then the offset for BCT0 in his example would not be 0x30 but 0x2B.  He must have replied to me in error what do you think?

 

 

Edited by osxfr33k

OP-LP3 OverPowered Laptop 17 inch, i7-8750H, 32GB memory, 256GB NvMe stock with windows 10 and added 512GB NvMe Samsung 970 Pro with MacOS 11.2.1, OpenCore 0.6.7.   New Asus Pro WS X299 Sage II intel i9-10980XE 18 core beast Big Sur 11.2.1. OpenCore 0.6.7,  Asus Z390-E i9-9900K 64GB G.Skill Ripjaws Sapphire Pulse RX580, Asus Sabertooth X79 (4) E5-2697 v2 (12 Core), Asus Maximus VIII Hero Alpha i7-7700K 64GB Corsair 2400, Asus Z97-Deluxe i7-4790K, Gigabyte Z77X-UP5-TH i7-3770k, Asus Maximux Formula Special Editions with Rampage Formula Bios conversion, Gigabyte GA-EP35-DS4, GA-EP45-UD3P, GA-G41M-ES2L, GA-Z68X-UD4-B3 and Quo MB.  MAC PRO EARLY 2008, MacPro Late 2012. Asus Notebooks: G51JX i7-720QM, G74SX-XT1 i7-2630QM, Asus G750JX-DB71 Haswell Processor i7-4700HQ GTX 770M 3GB (4).  Dell Laptops D820, D830, XPS M1530 (6), Dell 13-1567 (4), Older processors  i7 (3770K/4770k/6700k/7700K).  Older GFX Cards:  EVGA GT-640, EVGA GTX 760, EVGA GTX 770 (six),

Posted

Hi guys i did a patch for my battery. Its working but when i wake from sleep my laptop battery is %1. I dont know why. Here my DSDT.dsl

DSDT-BATTERY.dsl

Posted (edited)

hello all,

Do I need to patch SMD0, 256, ?

The next "Find" give me this. Is it accessed?

 If ((Arg0 == 0x0A))
                    {
                        SMD0 = Arg3
                    }

If I need to patch it the how do I proceed? The is no Offset to start with:

  OperationRegion (ERAM, EmbeddedControl, Zero, 0xFF)
            Field (ERAM, ByteAcc, NoLock, Preserve)
            {
                SMPR,   8, 
                SMST,   8, 
                SMAD,   8, 
                SMCM,   8, 
                SMD0,   256, 
                BCNT,   8, 
                SMAA,   8, 
                Offset (0x40), 
                SW2S,   1, 
                    ,   2, 
                ACCC,   1, 
                TRPM,   1,

 

Thank you for your answers.

System DSDT.aml

Edited by Stephan Malepa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...