Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
@KungFuJoe

Something I'd like to say in advance:
The patch for your DSDT affects *a lot* of methods, sprinkled all across the file. This means that I had to rename each and every one of those affected methods on their declaration only, so I can implement the patched method in the SSDT.

Overall that ended up in about 18 renames. Also, I had to find a huge load of external dependencies (Fields, Packages, Mutex, Methods) in the right scope, so I could mark them as external in the SSDT.

This was a ton of repetetive work, which easily introduces human errors. So PLEASE back up your EFI and only then try booting the attached. It may not even start. I assume that this won't work first time, and I have to debug it later on. Never had to do such a big patch :D.
 

Attachments

  • EFI.zip
    6.7 MB · Views: 76
@KungFuJoe

Something I'd like to say in advance:
The patch for your DSDT affects *a lot* of methods, sprinkled all across the file. This means that I had to rename each and every one of those affected methods on their declaration only, so I can implement the patched method in the SSDT.

Overall that ended up in about 18 renames. Also, I had to find a huge load of external dependencies (Fields, Packages, Mutex, Methods) in the right scope, so I could mark them as external in the SSDT.

This was a ton of repetetive work, which easily introduces human errors. So PLEASE back up your EFI and only then try booting the attached. It may not even start. I assume that this won't work first time, and I have to debug it later on. Never had to do such a big patch :D.

Thank you so much for doing this. I took a look at the changes and they are very extensive. Did you have to hand code everything or is there a method to generate a lot of the code?

I also noticed that SSDT-EC is removed from the new files. Was there a problem with the existing one or did you just incorporate it into SSDT-BATT?
 
@KungFuJoe

You shouldn't need to create a fake EC device, just rename EC0 to EC. I had cases where a fake EC device would mess with the battery state (charging, percentage, and so on), and since you have a working one, just use that.

It's a mix, but no - I didn't have to write that much, only about 200 lines, and the renames in your config - which are also round about 19 entries.

Please report back what booting this EFI folder does. Since I don't think it'll yet work and I then can go on and debug it.
 
@KungFuJoe

You shouldn't need to create a fake EC device, just rename EC0 to EC. I had cases where a fake EC device would mess with the battery state (charging, percentage, and so on), and since you have a working one, just use that.

It's a mix, but no - I didn't have to write that much, only about 200 lines, and the renames in your config - which are also round about 19 entries.

Please report back what booting this EFI folder does. Since I don't think it'll yet work and I then can go on and debug it.

Ok...boot basically went into a repeat loop with this screen over and over again (attached as zip because this forum, for some reason, says it's not an image). Also attaching my oc debug log as well.
 

Attachments

  • opencore-2020-08-02-201648.txt
    256 KB · Views: 45
  • IMG_1515.jpeg.zip
    931.7 KB · Views: 37
@KungFuJoe

That's a very good image that shows exactly where I need to look for errors. I need to get up early tomorrow, so I need to go to bed now, but I'll try to look at it tomorrow.

We should be able to get that to work, the SSDT is a solid base for now. Please revert back to your old EFI until I give you a new version.
 
@KungFuJoe

Hey... I really didn't sleep well/much this night, and I've got a long day in front of me. I will get back to you tomorrow, but I'm looking at the error logs in the mean time.
 
@KungFuJoe

Hey... I really didn't sleep well/much this night, and I've got a long day in front of me. I will get back to you tomorrow, but I'm looking at the error logs in the mean time.

No worries at all and appreciate the update. I think we are on much different time zones btw. It’s midnight where I’m at.

Get some rest and take all the time you need. You’re doing me a favor so definitely no obligation on your part.

Thanks!
 
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
 

Attachments

  • DSDT.aml
    142.8 KB · Views: 46
@twsps

I'll try to help you as soon as I've fixed @KungFuJoe's battery. Please be patient, those patches (also HP) can get very nervewrecking... xD
 
@KungFuJoe

Please try to boot the attached EFI, I just noticed an ultra stupid mistake I made, I can't really judge if that fixed it tho.
 

Attachments

  • EFI.zip
    6.7 MB · Views: 73
Status
Not open for further replies.
Back
Top