Contribute
Register

[Guide] How to patch DSDT for working battery status

Joined
May 7, 2018
Messages
3
Motherboard
thinkpad
CPU
i7
Graphics
630
Hi RehabMan.
After getting a clean dump and patched the DSDT with "[bat] Lenovo X230i", battery status is working fine on my ThinkPad P51. Thanks for your help!
Maybe you can add a comment in the patch to tell others the patch can also work on Lenovo ThinkPad P51.
hi ,can you share your dsdt? I can't deal with the batter of my p51
 

Feartech

Moderator
Joined
Aug 3, 2013
Messages
21,965
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
hi ,can you share your dsdt? I can't deal with the batter of my p51
shouldn't share DSDT, as you can cause more harm than good, ie, different BIOS versions, different BIOS options etc.

you should patch your own DSDT
 
Joined
May 7, 2018
Messages
3
Motherboard
thinkpad
CPU
i7
Graphics
630
shouldn't share DSDT, as you can cause more harm than good, ie, different BIOS versions, different BIOS options etc.

you should patch your own DSDT

thank you for replay me,I failed to try to deal with the error of dsdt,here is my dsdt,can help me to deal with the bat manger of p51?
 

Attachments

  • origin.zip
    71.3 KB · Views: 44

Feartech

Moderator
Joined
Aug 3, 2013
Messages
21,965
Motherboard
Asus N752VX-OpenCore
CPU
i7-6700HQ / HM170
Graphics
HD 530 1920 x 1080
Mac
  1. iMac
Mobile Phone
  1. iOS
thank you for replay me,I failed to try to deal with the error of dsdt,here is my dsdt,can help me to deal with the bat manger of p51?
i disassembled your files and saw an error, i commented out lines 153 and 155, resulting no errors

i haven't done any patches, that can be your job :)
 

Attachments

  • DSDT.dsl
    916.3 KB · Views: 109
Joined
May 7, 2018
Messages
3
Motherboard
thinkpad
CPU
i7
Graphics
630
%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202018-05-21%20%E4%B8%8B%E5%8D%886.22.20.png
i disassembled your files and saw an error, i commented out lines 153 and 155, resulting no errors

i haven't done any patches, that can be your job :)
thank you for your job!,my batter manger run well!
 
Joined
Aug 2, 2013
Messages
65
Motherboard
Intel Skylake-U Premium PCH
CPU
Core i7-6500U
Graphics
Intel HD Graphics 520 (1920x1080)
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
Hello @RehabMan,

thank you for your great guide and sharing all this knowledge :)

Please find attached:
  • Hardware information about my notebook (Tuxedo Infinitybook 13v2 [a Clevo rebrand])
  • The battery DSDT patch I created using your guide
  • My native acpi files
Battery status is showing and changes normally. Still I created the patch today and did not have much time to observe it.

EDIT: Sorry, there is one issue: The status lags behind and is not updated for some periods of time (see screenshot added to attachment).

Best regards,
Fox
 

Attachments

  • InfinityBook_13v2_Battery_Status_Patch.zip
    35.2 KB · Views: 28
  • battery_status_lags.png
    battery_status_lags.png
    67.9 KB · Views: 64
Last edited:

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,149
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Hello @RehabMan,

thank you for your great guide and sharing all this knowledge :)

Please find attached:
  • Hardware information about my notebook (Tuxedo Infinitybook 13v2 [a Clevo rebrand])
  • The battery DSDT patch I created using your guide
  • My native acpi files
Battery status is showing and changes normally. Still I created the patch today and did not have much time to observe it.

EDIT: Sorry, there is one issue: The status lags behind and is not updated for some periods of time (see screenshot added to attachment).

Best regards,
Fox

No DSDT.aml provided.

Note: It seems to me that the patch file already in the repo is a match: battery_Microxperts-u731ga1.txt
 
Joined
Aug 2, 2013
Messages
65
Motherboard
Intel Skylake-U Premium PCH
CPU
Core i7-6500U
Graphics
Intel HD Graphics 520 (1920x1080)
Mac
  1. MacBook Pro
Mobile Phone
  1. iOS
No DSDT.aml provided.

Note: It seems to me that the patch file already in the repo is a match: battery_Microxperts-u731ga1.txt

Ok, true. Looks like a perfect match. I just looked into the Clevo patches. So mine would be redundant. I have one recommondation: Since the MicroXpert computer also looks like a Clevo rebrand and I know many different companies which do Clevo rebrands (TuxedoComputers, mySN, MicroXpert, one.de, ...) it seems if you rename the file in the repository to Clevo it would be much easier to find for most users.

Find in the attachment my updated folder including DSDT.aml and decompiled DSDT.dsl file (tough it is not needed anymore because its already in your repository).

Regarding my issue about lagging behind status in the top menu bar, it is gone if I put the ACPIBatteryManager.kext into /Library/Extensions/ instead of /EFI/Clover/kext/Others.

Thanks again.
BR Fox
 

Attachments

  • InfinityBook_13v2_Battery_Status_Patch.zip
    131.8 KB · Views: 23
Joined
Jul 16, 2010
Messages
445
Motherboard
Asus Pro WS x299 Sage II
CPU
i9-10980XE
Graphics
RX 5500 XT
Mac
  1. Mac Pro
Mobile Phone
  1. iOS
I would like to contribute my battery patch for HP Pavillion G6-1d28dx. Native and patched DSDT and the Patch itself all zipped. Its basically a modified HP Envy 14 as in your OP.

I have a few questions though, I don't understand why the code into method label _Q09 is being used for BRC0 and sBFC0 under 16 bit methods? Is the "s" in sBFC0 needed for spacing or shifting?

Since these are 16 bit they are not considered stored into H_EC buffers, BFC0, BDV0, BSN0,BMD0, BPR0, BRC0, BPV0 and FANR? Only 32 bit and above if they were stored into H_EC, EC0 or EC then one would need the WECB utility instead of the RECB one?

Also confused on the Offsets they do seem to be in a numerical order goes from 0x18 to 0x20 unless its rounds up to the next byte then from there to 0x70 doesn't seem to add up correctly?

Searchings posts from this thread found useful links below to help understand the way this works.

https://www.tonymacx86.com/threads/...derstand-the-guide.190844/page-3#post-1239016

https://www.tonymacx86.com/threads/dell-inspiron-15-7559-fan-info.199904/page-3#post-1307846

https://www.tonymacx86.com/threads/...keyboard-backlight.233373/page-2#post-1596776

Battery works perfect charging/discharging %.

re-Edited:

I think I have the Offsets figured out re-attached files. BMN0 0x20 + 8/8 = 0x21

BCT0 0x20 +120/8 = 15 0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f

BMN0 offset is 0x21
BCT0 offset is 0x2f
 

Attachments

  • DSDT_Native.aml.zip
    28.9 KB · Views: 35
  • DSDT_Patched.aml.zip
    29.4 KB · Views: 42
  • HP-G6-1d28dx_Bat_Patch.txt.zip
    2.8 KB · Views: 27
Last edited:
Top