Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
thanks for the replay ,

i have already patched before my DSDT to make my battery working and it's working but i don't want to use DSDT.aml in my acpi folder (multiboot with windows) so i need to generate an SSDT-BAT.aml but i did not understand well how to do that.
i'm usine opencore and everything is working fine with SSDT-XXX prebuild file and kext only the battery not working
if can help to generate the SSDT-BAT.aml please.
Read this guide, second post

[Guide] Using Clover to "hotpatch" ACPI
 
thanks for the replay ,

i have already patched before my DSDT to make my battery working and it's working but i don't want to use DSDT.aml in my acpi folder (multiboot with windows) so i need to generate an SSDT-BAT.aml but i did not understand well how to do that.
i'm usine opencore and everything is working fine with SSDT-XXX prebuild file and kext only the battery not working
if can help to generate the SSDT-BAT.aml please.

I made that SSDT-BATT for you, but you need to test it out, was quite a lot of code. Please also don't rename EC0->EC, just keep EC0 as it is and use SSDT-EC (fake-ec device), if you don't yet do so already.
 

Attachments

  • SSDT-BATT.aml
    3.6 KB · Views: 70
@BlvckBytes
Hello !
for whatever reason I can't reply to your message, I'm getting this error


anyways great you are back to continue the development

I'll look into what DSDTs I have and send you complex ones, or if you want I'll send you all the DSDTs I have, whatever you like

One more thing, I saw this on another forum and thought it might be helpful somehow
https://github.com/1Revenger1/BatteryPatcher looks like someone already attempted to make battery patcher, idk how good is this tool as I haven't tried it

WOW, this guy really approached this seriously, he's also interpreting a lot of acpi-code and parsing into his own models, just like I now started doing in the python-rewrite. I will definitely have a closer look at it, to not repeat any work that has already been done. Just should go to bed soon as I'll have to get up somewhat early.

Yes, you can just send me what you got around, I will look through it, no problem. Happy to see you still being that active :).

// EDIT: Just tried the tool, it crashed on me. Will try something else tomorrow.
 
Last edited:
WOW, this guy really approached this seriously, he's also interpreting a lot of acpi-code and parsing into his own models, just like I now started doing in the python-rewrite. I will definitely have a closer look at it, to not repeat any work that has already been done. Just should go to bed soon as I'll have to get up somewhat early.

Yes, you can just send me what you got around, I will look through it, no problem. Happy to see you still being that active :).

// EDIT: Just tried the tool, it crashed on me. Will try something else tomorrow.
that’s nice, I didn't have the time to test his tool but it seems promising, you should try to contact him maybe

Well battery patching is getting kinda boring for me to do lol, same process over and over again, probably time to move on to something new and more challenging, anyways here is some DSDTs (about 25)
 

Attachments

  • DSDTs.zip
    1 MB · Views: 47
hi,
i used the guide that you send me but i think it's game over for me i get some error that i can't fix

i attached my patched ssdt.dsl and the ssdt-bat.dsl so can you help now please because i think i will stay 1000 years to trying to get it working.
Hello, guys!

// Comment:

If you need any help, just post your native DSDT along with an existing rehabman patch, if it exists. Otherwise, I'll try to patch it from scratch. If you want me to implement it properly, post your EFI folder aswell.

I will help as many people as possible!

My solution was: https://www.tonymacx86.com/threads/opencore-battery-patch.295289/post-2101803

I am working on getting my laptop up and running with OpenCore, switching from clover right now... What works: Audio, USB, USBC (Data + External Monitors), Trackpad, Touchscreen, WiFi & BT. What doesn't: My DAMN battery indicator...

// Note: DO NOT follow this immense amount of GARBAGE I did below, it will only screw your system up. Scroll down further, I have this solved, use the other approach instead. (https://www.tonymacx86.com/threads/opencore-battery-patch.295289/post-2101803)

This patch works 100% for my laptop (with clover, patching DSDT): https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Razer-Blade-2014.txt

I tried my BEST to get this working in OpenCore. What I came up with (step by step, so you get my train of thought right now):
* Renamed eisaID PNP0C0A to PNP0C99 (to disable DSDT BAT0 hooking from SMCBattery)
* Renamed Device BAT0 to BATX (to don't have overlapping names in same scope)
* Renamed eisaID PNP0C0D to PNP0C98 (to disable DSDT LID0 hooking from SMCBattery)
* Renamed Device LID0 to LIDX (to don't have overlapping names in same scope)
* Renamed eisaID PNP0C09 to PNP0C00 (to disable DSDT EC0 hooking from AppleACPIEC)

Then, I re-defined those devices in SSDTs. The SSDT-EC contains EC, LID0 and BAT0, copied from the Clover DSDT which got patched with the above patch from RehabMan. I added the External lines, which should point to the correct resources in main DSDT, at least I hope I did it correctly.

Now - what's the outcome? I actually got a battery indicator! And it goes down! But - it just does not go up or show the charging bolt symbol, so it's partially corruped. I have no further ideas, since my knowledge is very limited in the ASL language.

Attached: My OC EFI, my IOREG and my origin from clover - already run through iasl decompile.

Please - if someone has any ideas - help me out here, I would be so happy if open core would finally be complete - I'm pretty close! :)
Thank you lots!

Hello, guys!

// Comment:

If you need any help, just post your native DSDT along with an existing rehabman patch, if it exists. Otherwise, I'll try to patch it from scratch. If you want me to implement it properly, post your EFI folder aswell.

I will help as many people as possible!

My solution was: https://www.tonymacx86.com/threads/opencore-battery-patch.295289/post-2101803

I am working on getting my laptop up and running with OpenCore, switching from clover right now... What works: Audio, USB, USBC (Data + External Monitors), Trackpad, Touchscreen, WiFi & BT. What doesn't: My DAMN battery indicator...

// Note: DO NOT follow this immense amount of GARBAGE I did below, it will only screw your system up. Scroll down further, I have this solved, use the other approach instead. (https://www.tonymacx86.com/threads/opencore-battery-patch.295289/post-2101803)

This patch works 100% for my laptop (with clover, patching DSDT): https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Razer-Blade-2014.txt

I tried my BEST to get this working in OpenCore. What I came up with (step by step, so you get my train of thought right now):
* Renamed eisaID PNP0C0A to PNP0C99 (to disable DSDT BAT0 hooking from SMCBattery)
* Renamed Device BAT0 to BATX (to don't have overlapping names in same scope)
* Renamed eisaID PNP0C0D to PNP0C98 (to disable DSDT LID0 hooking from SMCBattery)
* Renamed Device LID0 to LIDX (to don't have overlapping names in same scope)
* Renamed eisaID PNP0C09 to PNP0C00 (to disable DSDT EC0 hooking from AppleACPIEC)

Then, I re-defined those devices in SSDTs. The SSDT-EC contains EC, LID0 and BAT0, copied from the Clover DSDT which got patched with the above patch from RehabMan. I added the External lines, which should point to the correct resources in main DSDT, at least I hope I did it correctly.

Now - what's the outcome? I actually got a battery indicator! And it goes down! But - it just does not go up or show the charging bolt symbol, so it's partially corruped. I have no further ideas, since my knowledge is very limited in the ASL language.

Attached: My OC EFI, my IOREG and my origin from clover - already run through iasl decompile.

Please - if someone has any ideas - help me out here, I would be so happy if open core would finally be complete - I'm pretty close! :)
Thank you lots!
Can you help please
 

Attachments

  • DSDT_patched.dsl
    725.2 KB · Views: 41
  • SSDT-BATT.aml
    1.5 KB · Views: 41
@karimwassim

What do you need help with? I already gave you that SSDT, you just need to try and see if it works...

If you'd like to, you can upload your EFI folder and I can set everything up.
 
Hey there!
After switching from Clover to OC and upgrading to Big Sur and with the intention to hold my EFI clean I stumbled over this thread to create a better battery SSDT than before as i just patched and used the full blown one. Apparently this process is harder than i thought and if someone could take a look at this I would be very happy.

I attached a patch which had worked flawlessly for me and of course my DSDT.
 

Attachments

  • DSDT.aml
    231.2 KB · Views: 51
  • battery_HP-G6-2221ss.txt
    16.9 KB · Views: 38
@karimwassim

What do you need help with? I already gave you that SSDT, you just need to try and see if it works...

If you'd like to, you can upload your EFI folder and I can set everything up.
hi friend i did not see your preview answer,

the ssdt-batt that you send me was not working so i send you my EFI folder please,
i compared the ssdt-batt that you send me with my patched dsdt i did find many difference but many method look like the original dsdt and not the patched method,
 

Attachments

  • EFI.zip
    28.3 MB · Views: 63
Last edited:
here you go
Seems like HP changed ACPI related stuff in the latest BIOS. I've updated mine to 01.14.01 Rev.A and made some adjustments to the patch. Then created an SSDT-BAT and also SSDT-BATC with SSDT-DBAT, according to VirtualSMC documentation. No I have working battery status in macOS and it also doesn't corrupt Windows, when booted with OpenCore. So, you can grab these files for HP Probook 450 G5

Screenshot 2020-11-20 at 01.54.53.png
 

Attachments

  • SSDT-BAT.aml
    5.2 KB · Views: 60
  • patch.txt
    7 KB · Views: 63
  • SSDT-BATC.aml
    2 KB · Views: 49
  • SSDT-DBAT.aml
    691 bytes · Views: 47
  • patches_OC.plist
    9.4 KB · Views: 59
You didn’t copy the renaming patches from patches.plist to your config.plist ............................

@hawk2212 @moh.96

i have a question, After you helped me get my Battery Status to work my Battery always on red alert "battery Low" even in the windows same problem. i have a windows on different SSD and i faced this problem after patching battery i think patching battery corrupt windows partition.also i did fresh install and it ask me to blag my charger while i install the Catalina and the battery was 92%

please help me.

image attached
 

Attachments

  • Screen Shot 2020-11-21 at 12.21.54 PM.png
    Screen Shot 2020-11-21 at 12.21.54 PM.png
    101.5 KB · Views: 31
Last edited:
Status
Not open for further replies.
Back
Top