Contribute
Register

<< Solved >> OpenCore battery patch

Status
Not open for further replies.
Hello, I've followed Rehabman guide in order to create a patch for my battery, but haven't been successful... here I share my original DSDT + the SSDT that I have so far, the config file (to check the renamings are done correctly. The patch is the one attached. Thank you very much for your help and Happy New Year!
HP laptops have similar patches, I've done that patch dozen of times lol

anyways download the files below and do the following
1- Delete any previous battery patches and it's renaming
2- Copy SSDT-BAT to your ACPI folder
3- Copy renaming patches to your config (use ProperTree for example)
4- Make sure you have SMCBatteryManager in your kexts folder
5- Make sure you do NOT have DSDT in your ACPI folder
6- Remember to keep EFI backup just in case and restart

I will tell you what you did wrong in your patch after verifying the patch below works and happy new year :)
 

Attachments

Just tested it and can confirm you its working! I will give it propper testing the next days to check if the readouts are "correct", but at least its showing up with OpenCore without using a patched DSDT. Thank you very much! Looking forward to your reply with the things I did wrong... I had already given up, to be honest!
 
Hello again, did you try to disable battery patch, renaming patches and SMCBatteryManager and boot into Windows through Opencore ?

check if you get the same result
I tried booting windows with opencore without patch fixes and the new device doesn't appear. it is as if windows read the apple device. It also happens with SSDT-PNFL, in fact if I enable the hidden peripherals I find this one from apple (see attached photo). If I delete SSDT and patch everything back to normal.
 

Attachments

  • Immagine 1.png
    Immagine 1.png
    143.1 KB · Views: 44
Just tested it and can confirm you its working! I will give it propper testing the next days to check if the readouts are "correct", but at least its showing up with OpenCore without using a patched DSDT. Thank you very much! Looking forward to your reply with the things I did wrong... I had already given up, to be honest!
Ok so the patch that I’m using (which I made) is little bit different than the patch you included but both should work fine

the SSDT you created looks good, probably the only thing missing is if _OS darwin statement which is not necessary (but it fix the problem when booting windows using opencore, Windows battery will not work since SSDT is loaded into Windows and it will mess up with windows battery)

Renaming patches is your problem
Couple of notes to consider

  • You ONLY have to rename the methods you modified in the dsdt (SMRD, SMWR, GBIF, GBCO, UPBI and UPBS)
  • Renaming RE1B, RECB etc is useless since the renaming patches are applied to DSDT only and your DSDT doesn’t have those methods
  • Also renaming ERAM to ERAX or whatever is wrong cuz you will disable the whole operationregion (as I said before you should only rename patched methods)
  • you should understand that renaming methods is actually to disable them so that the SSDT will load (in case the SSDT have the same method name In the DSDT then it will fail to load)

Now lets assume we wanna rename GBIF to GBIX or any name
You should consider the following
  • The name you are changing the method to (GBIX) should not be used in the DSDT
  • you only need to change method GBIF and nothing else
for example in ur renaming patch GBIF to XGBI you used 47 42 49 46 to 58 47 42 49
in this case every GBIF will be renamed XGBI which will screw things (cause GBIF is called in the DSDT in HWMC method)

Solution is to include some byte before the method name so it will be 8E 47 42 49 46 to 8E 58 47 42 49 (check the screenshot below) in this case only Method (GBIF, 1, NotSerialized) will be renamed to Method (XBIF, 1, NotSerialized)

To make things easier for you just change the last or first letter of the method name to X (GBIF -> XBIF)

I will attach folder contains patched dsdt.dsl unpatched dsdt.dsl and dsdt-l.dsl in case you wanna take a look at it
finally I hope my explanation make some sense (English isn’t my first language so pardon me)
 

Attachments

  • Screen Shot 2020-12-31 at 12.14.03 AM.png
    Screen Shot 2020-12-31 at 12.14.03 AM.png
    256.4 KB · Views: 44
  • HP Spectre x360 13-ac0XX.zip
    1.1 MB · Views: 38
Last edited:
I tried booting windows with opencore without patch fixes and the new device doesn't appear. it is as if windows read the apple device. It also happens with SSDT-PNFL, in fact if I enable the hidden peripherals I find this one from apple (see attached photo). If I delete SSDT and patch everything back to normal.
Opencore injects SSDTs, renaming patches and SMBios to Windows that’s why you see those weird new drivers that Windows doesn’t know how to deal with, of course this should only happen when booting Windows from Opencore (if you boot Windows through Windows Boot Manager everything should be fine)

the solution to this is to add if (_OSI(“Darwin”) to your SSDTs (I have already added this to the battery patch but somehow it still mess with Windows battery ‍♂️♂️)

alternative solution is to use rEFInd Boot Manager (haven’t tried it)
 
Opencore injects SSDTs, renaming patches and SMBios to Windows that’s why you see those weird new drivers that Windows doesn’t know how to deal with, of course this should only happen when booting Windows from Opencore (if you boot Windows through Windows Boot Manager everything should be fine)

the solution to this is to add if (_OSI(“Darwin”) to your SSDTs (I have already added this to the battery patch but somehow it still mess with Windows battery ‍♂️♂️)

alternative solution is to use rEFInd Boot Manager (haven’t tried it)
Hi, I've done other tests. I checked that all SSDTs had if (_OSI ("Darwin") and I restarted windows; the peripherals were still there, but it was enough to uninstall them and they never reappeared, I probably had to proceed with an nvram reset. So I confirm that ssdt -bat with if (_OSI ("Darwin") works. However hp assistent does not detect the type of battery which still works correctly even in windows. This depends on the acpi patches (attached). There is a way to make them load only in Mac ?
 

Attachments

  • Schermata 2020-12-31 alle 12.56.10.png
    Schermata 2020-12-31 alle 12.56.10.png
    352 KB · Views: 35
Hi, I've done other tests. I checked that all SSDTs had if (_OSI ("Darwin") and I restarted windows; the peripherals were still there, but it was enough to uninstall them and they never reappeared, I probably had to proceed with an nvram reset. So I confirm that ssdt -bat with if (_OSI ("Darwin") works. However hp assistent does not detect the type of battery which still works correctly even in windows. This depends on the acpi patches (attached). There is a way to make them load only in Mac ?
HP assistance issue is probably caused by opencore injects SMBios to Windows, u can solve that by doing the following in ur config
CustomSMBIOSGuid = Yes
UpdateSMBIOSMode = Custom
 
Hello, I would like to create an SSDT for the Battery of my Asus N750JK. You can help me?, I am attaching my DSDT files on which the patch ASUS-G75vw works. Thanks.
 

Attachments

  • DSDT_patch.aml
    81.4 KB · Views: 38
  • DSDT_orig.aml
    79.5 KB · Views: 46
Hello, I would like to create an SSDT for the Battery of my Asus N750JK. You can help me?, I am attaching my DSDT files on which the patch ASUS-G75vw works. Thanks.
Creating an SSDT of this patched DSDT was a nightmare tbh, 20 patched methods and a ton of declaration to add, hope it will work after all of this

1- Copy SSDT-BAT to ACPI folder
2- Copy all renaming patches to your config (use ProperTree)
3- Make sure you have SMCBatteryManager in Kexts, also make sure you do NOT have DSDT in ACPI
4- Remember to keep EFI backup and restart!
 

Attachments

  • Asus N750JK - Battery Patch.zip
    6.3 KB · Views: 50
Creating an SSDT of this patched DSDT was a nightmare tbh, 20 patched methods and a ton of declaration to add, hope it will work after all of this

1- Copy SSDT-BAT to ACPI folder
2- Copy all renaming patches to your config (use ProperTree)
3- Make sure you have SMCBatteryManager in Kexts, also make sure you do NOT have DSDT in ACPI
4- Remember to keep EFI backup and restart!
Hi.
While I'm not the original requester, I was very happy someone had the trouble of creating an OC patch for our laptop's battery.
After testing, I can sadly report that under BigSur 11.0.1 and OC 0.6.4, the patches make the laptop instantly reboot.
I thought that even though my laptop is the same model as isaza15's the DSDT might be different enough, but after decompiling both DSDT's and comparing them using FileMerge, there's only one noticeable difference (which I think hasn't got anything to do with the instant reboot).

isaza15's DSDT Line 201:
OperationRegion (GNVS, SystemMemory, 0xCAA71C18, 0x02B2)
My DSDT Line 201:
OperationRegion (GNVS, SystemMemory, 0xBEB1BC18, 0x02B2)

I haven't tried booting with his patched DSDT yet, but just wanting to let you know the results.
If you need, I'm available for more tests as I'd love to have Battery Status working since it's one of the last things that aren't working on that laptop.

Edit: I've also added some missing parameters to the patches as they make OC complaint about missing values on each patch, even tho it doesn't really change the outcome.

Attached is my DSDT and EFI folder.

Many thanks for your hardwork and I hope you have a great and safe 2021!
~ Marcos
 

Attachments

  • DSDT.aml.zip
    29.6 KB · Views: 46
  • EFI.zip
    2.9 MB · Views: 57
Status
Not open for further replies.
Back
Top