Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
tmbt
You are welcome! Did it solve the delay of detecting the charger when it’s plugged in/unplugged?

AdorableTeemo
FINALLY !! Happy To help, without BlvckBytes it wouldn’t be possible (he made the patch and I just corrected couple of things)

Thank you moh and BlvckBytes! :D
 
tmbt
You are welcome! Did it solve the delay of detecting the charger when it’s plugged in/unplugged?

AdorableTeemo
FINALLY !! Happy To help, without BlvckBytes it wouldn’t be possible (he made the patch and I just corrected couple of things)
Nope there is still a delay but i think i can live with that. Maybe a new version of VirtualSMCBattery kext will solve the problem. When i have time i will try to open an issue report on github and see what they answer. Or i could try an older VirtualSMC version ..

Thanks again !

Mattia
 
@moh.96

First of all, thanks a lot for helping out so many people around here, you're awesome! :) And the second thing: could you tell me what the diff between my patch and the working one was? I kind of made that patch in a hurry, there probably were some quite dumb mistakes in there.
 
@moh.96

First of all, thanks a lot for helping out so many people around here, you're awesome! :) And the second thing: could you tell me what the diff between my patch and the working one was? I kind of made that patch in a hurry, there probably were some quite dumb mistakes in there.
Happy to help people! :), btw you are the awesome one ;)

anyways what was missing from your EFI you sent is probably three things

• No SSDT-EC, you probably forgot it (that’s why he was stuck on [EB|#LOG:EXITBS:START])

•Renaming patches, although it was correctly done but I noticed that if the name of the method starts with a number then a lot of errors will pop up out of nowhere (weird) so I renamed the methods to XSTA, YSTA etc

• In SSDT-Bat, EmbeddedController was named EC while it should be EC0
 
@moh.96

Thank you :). I usually don't use a fake EC device, which is why I add rename EC0 to EC and thus have EC in my SSDT. Maybe it's smarter to always use a fake EC, I'm not completely sure yet.

Method definition opcodes are 14, AFAIK. Thus, every method should start with 14. But I may have scrambled up some bytes there.
 
@moh.96

Thank you :). I usually don't use a fake EC device, which is why I add rename EC0 to EC and thus have EC in my SSDT. Maybe it's smarter to always use a fake EC, I'm not completely sure yet.

Method definition opcodes are 14, AFAIK. Thus, every method should start with 14. But I may have scrambled up some bytes there.
Well opencore guide suggests to NOT disable or rename Embedded Controller for laptops, creating a fake EC while keeping the original EC is the best solution

I didn’t quite understand what you mean by “Method definition opcodes are 14”
But from my little experience renaming methods with a number in the beginning is a bad idea ‍‍
 
Last edited:
@moh.96

Right, probably best to leave the native EC alone and create a fake one, I should start doing that from now on, I don't know why I was so stubborn about that.

What I mean is the following... When you write the ACPI source language for a new method, thus a method definition, it will look something like this:

Method (name, argCount, Serialized/NotSerialized)

You *define* a method there, you don't invoke it. An invocation would be name (). If this code gets assembled to bytes, there is an operation-code for "make method", which is 0x14 in HEX. Open up an .aml in HexFiend, f.e.

It should be built up like this: 14 + method size + method name, in short: 14<size>5F42424E, would be method _BBN. <size> can be either one byte or multiple, I don't yet know how to automatically determine how many will follow.

But be careful, if a 14 is inside the size, you need to ignore it and get the 14 before that. That's what can throw you off. But by coping from the preamble 14, you will *always* only replace the definition, no invocations. That's how I did it until now, it may need further research.

I hope that made any sense, I kind of have a hard time concentrating right now...
 
Could anyone help me out here? Matebook X Pro 2020 wont boot without patched battery, so after getting it to work
in my DSDT I want to transform it into a hotpatch. Did all the necessary stuff, but stuck at boot; this should be patch related. Would love to get rid of the skip and count part, but I simply dont understand that part of the tutorial.
 

Attachments

  • DSDT.aml
    259.5 KB · Views: 46
  • Hotpatch Renames.txt
    461 bytes · Views: 53
  • SSDT-HWBT-MatebookXPro2020-Stripped.dsl
    15.1 KB · Views: 47
Good day @BlvckBytes , Still no time to look at my files? Asking just to make sure u didnt forget about em, im totally fine with waiting, appreciation for what you do to community)
 
Could anyone help me out here? Matebook X Pro 2020 wont boot without patched battery, so after getting it to work
in my DSDT I want to transform it into a hotpatch. Did all the necessary stuff, but stuck at boot; this should be patch related. Would love to get rid of the skip and count part, but I simply dont understand that part of the tutorial.

Hi, so I took a look at your files and well done, haven't checked the SSDT line by line but it looks good

I think your problem is with the renaming patches so delete the renames in your config.plist and add those (copy them with propertree)
 

Attachments

  • patches.plist
    2.7 KB · Views: 60
Last edited:
Status
Not open for further replies.
Back
Top