Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
Hello @BlvckBytes ,

I have an HP ZBook G4 which I cannot get my BAT status to work correctly.

Would you mind to help me out?
I am using OC, and SSDT patch would be much appreciated.



Thanks,
twsps

I now had the time to look at your DSDT. I got a HP ZBOOK G5 STUDIO for my software-developer internship, which I already hackintoshed a few weeks ago (https://github.com/BlvckBytes/ZBOOK_G5_HACK). Our battery related EmbeddedControl regions and methods are the exact same as far as I could tell, so you should be fine using my SSDT-BATT and the renames in my config.

If you already have an OC setup, just without a battery, post your EFI and I will add the SSDT and all the renames for you. You can also go on your own by inspecting my REPO, just do whatever's easier for you.
 
I'm sorry for my English, someone can help me with my battery, I have everything working except the battery that is frozen really charge but the measured is frozen. tengo un hp pavilion 15 i7 8750h,

Please also post your current EFI folder so I can understand how your whole setup works.
 
@KungFuJoe

I'm actually running out of ideas on how to fix this... I don't see any other mistakes, other than what I've attached now. Please try it out again, but it probably will result in the same issues. Post a picture anyways, please - I don't want to give up on it.

What's basically the problem, AFAIK (to document this, for myself and others):
The native (untouched) Method _BST from ACPI has those calls inside of it's body:
Code:
Store (^^LPCB.EC0.BSTS (), Local0)
Store (^^LPCB.EC0.BCRT (), Local1)
Store (^^LPCB.EC0.BRCP (), Local2)
Store (^^LPCB.EC0.BVOT (), Local3)

EC0 gets replaced to EC, don't worry about that. It needs to evaluate the return values of BSTS, BCRT, BRCP and BVOT, one after the other, to store them into method-local variables.

Since your images only talk about BCRT, BSTS should be fine to call. I also overrode BSTS, and it uses the Fields declared inside the IndexField body, just like BCRT - which doesn't work...

I forgot to set the other regions to Lock instead of NoLock, which basically means that you have to wait to access the fields until they are not in use, if I understood that correctly. Maybe that will stop some kind of race-condition here?

The problem with all of this is that I don't know how IndexField works. I understand OperationRegion and it's corresponding Field assignment block, so I know how to override it. Maybe it's a whole different story with IndexField, but it's so damn hard to find informations about it :(.

I got the same behavior as before.

I was thinking maybe trying a different approach. Instead of trying to create an SSDT patch from the patched DSDT...would it be easier just to keep the patched DSDT (for battery) and also patch the same DSDT for the other renames I have in ACPI - Patch in my config.plist? That's really the issue I'm facing (I believe) as using a patched DSDT, from what I've been told, will basically wipe out anything in the ACPI - Patches section.

This is a pretty old laptop and there will be no firmware updates or hardware changes in the future.
 
I got the same behavior as before.

I was thinking maybe trying a different approach. Instead of trying to create an SSDT patch from the patched DSDT...would it be easier just to keep the patched DSDT (for battery) and also patch the same DSDT for the other renames I have in ACPI - Patch in my config.plist? That's really the issue I'm facing (I believe) as using a patched DSDT, from what I've been told, will basically wipe out anything in the ACPI - Patches section.

This is a pretty old laptop and there will be no firmware updates or hardware changes in the future.
shouldn't use a DSDT.aml with OpenCore
 
@KungFuJoe

Loading a DSDT is a pretty "quick&dirty" approach which is against the rules of OC. They want to provide a stable and futureproof experience, which you might ruin for yourself by loading a whole DSDT.

Are you really using my whole EFI folder, not just copying stuff around? And if yes, please make another picture, since some small details in the error-logs might change - as I've said.

What I did so far is a very solid base, maybe you'll find someone else that can take a look at it too, four eyes are better than two.
 
@KungFuJoe

Loading a DSDT is a pretty "quick&dirty" approach which is against the rules of OC. They want to provide a stable and futureproof experience, which you might ruin for yourself by loading a whole DSDT.

Are you really using my whole EFI folder, not just copying stuff around? And if yes, please make another picture, since some small details in the error-logs might change - as I've said.

What I did so far is a very solid base, maybe you'll find someone else that can take a look at it too, four eyes are better than two.

Attaching new files. I have been copying your entire EFI folder with the exception of the bootx64.efi and opencore.efi. I'm replacing those with the debug versions to capture log output.
 

Attachments

  • opencore-2020-08-09-181133.txt
    256 KB · Views: 52
  • screenshots.zip
    15.3 MB · Views: 34
@KungFuJoe

Okay, it literally didn't change anything. Wow. Since I'm out of ideas fow now, I'm going to take a step back and post again if I got any new results. I'll definitely keep this in the back of my head. Thank you for running my EFIs and for your patience.
 
@KungFuJoe

Okay, it literally didn't change anything. Wow. Since I'm out of ideas fow now, I'm going to take a step back and post again if I got any new results. I'll definitely keep this in the back of my head. Thank you for running my EFIs and for your patience.

Appreciate all your work in trying to get this resolved.

BTW, would post #2 in this thread be a good place for me to start trying to figure this out on my own?

 
Hello @BlvckBytes ,

I have an Inspiron 5548 which almost everything works but I cannot get my battery status to work with the SSDT that I created, patching my DSDT with Rehabman battery patch works but I'd prefer using an SSDT

Would you mind to help me out?
I'm using OC, I attached native DSDT, patched DSDT and my attempt of SSDT-BATT.

Thanks
 

Attachments

  • DSDT_orig.aml
    81.7 KB · Views: 43
  • DSDT_patched.aml
    82.8 KB · Views: 41
  • SSDT-BATT.aml
    2 KB · Views: 47
@KungFuJoe

Yes, that guide should help you learn everything you need to attempt a hotpatch. There is also a tutorial on how battety patching itself works on the DSDT level, but since you already found a working patch, you can follow along easily.
 
Status
Not open for further replies.
Back
Top