Jump to content

[Kext] ECEnabler 1.0.3 - Instant battery status (sorta)


1Revenger1
 Share

14 posts in this topic

Recommended Posts

Over the past few days, I've been working on ECEnabler, with u/midi1996's help with testing.

ECEnabler is a Lilu plugin which allows macOS to read any size of EC field, meaning that no more ACPI patches are needed to split EC fields up within ACPI. I got tired of trying to make a complicated automated ACPI battery patcher (like SSDTTime), especially when dealing with all different vendors.

I eventually had the idea to try patching macOS instead, which turns out to be much easier. Hopefully this saves you guys a little time with not having to go through Rehabman's patching guide :)

Link: https://github.com/1Revenger1/ECEnabler

Obligatory picture showing it working:
r/hackintosh - ECEnabler: No more ACPI patches for battery! (Sorta)

There are a few caveats to this plugin:

  1. You may still need ACPI patches to combine data from 2 batteries
  2. This plugin will not help some devices such as the Surface Pro 7 which don't use ACPI Operating Regions/Fields to get their battery info.

 

Supported macOS versions: Mac OS X Lion (10.7) through macOS Ventura (13)

Edited by 1Revenger1
Ventura
  • Like 11
  • Thanks 3
Link to comment
Share on other sites

3 hours ago, 1Revenger1 said:

Unfortunately doesn't work in macOS Lion, since Lilu doesn't support that version. We've tested from Mountain Lion all the way to Big Sur though and have had great success.

 

Lilu supported 10.6+ (not all APIs will be functional).

https://github.com/acidanthera/Lilu/commit/244a51a957ee49f1a60dec9cd680ea0e2fdafcd3

Link to comment
Share on other sites

27 minutes ago, Andrey1970 said:

 

Lilu supported 10.6+ (not all APIs will be functional).

https://github.com/acidanthera/Lilu/commit/244a51a957ee49f1a60dec9cd680ea0e2fdafcd3

I did test with the "-liluforce" boot arg in 10.7, and it does appears to apply the patches correctly (though I don't have an old enough device to test with that has a working EC).
Without "-liluforce" though, Lilu disables itself, and breaks ECEnabler, so I figured it was safer to just say it was unsupported. Attached is the log without "-liluforce"

log.txt

Link to comment
Share on other sites

6 minutes ago, vit9696 said:

That's a bug, best to always be reported to bugtracker. Fixed in master.

Wasn't aware it was a bug, sorry.

I've just tested on my system though, and it works in 10.7. I'll update the readme and post, thanks!

  • Like 1
Link to comment
Share on other sites

Thank you!

 

Question:  just drop this in EFI?

 

What patches are you referring to?

 

1 SSDT-EC.aml

2 EC0 to EC rename

3 SSDT-USBX-EC.am.

4 Battery patches in ACPI>DSDT>Patches

Link to comment
Share on other sites

On 5/5/2021 at 3:09 PM, makk said:

1 SSDT-EC.aml

2 EC0 to EC rename

3 SSDT-USBX-EC.am.

4 Battery patches in ACPI>DSDT>Patches

You still need a device named EC to boot Catalina+, so you still need SSDT-EC or SSDT-USBX-EC (my preference is to use those over EC0 to EC rename)
Battery patches which split read/writes to 'Field Units' (Values within ACPI Fields) greater than 8 bits in size can be dropped now.
 

SMCBatteryManager/ACPIBatteryManager and Lilu are both required.

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, 1Revenger1 said:

You still need a device named EC to boot Catalina+, so you still need SSDT-EC or SSDT-USBX-EC (my preference is to use those over EC0 to EC rename)
Battery patches which split read/writes to 'Field Units' (Values within ACPI Fields) greater than 8 bits in size can be dropped now.
 

SMCBatteryManager/ACPIBatteryManager and Lilu are both required.

 

 

Thanks Rev

I'm unsure what is above 8bits in my config.plist

ACPI>Patch 

38 or so patches

 

Can you look at my config.plist

config.plist.zip

SSDT-4x0G2b.aml.zip

Edited by makk
Link to comment
Share on other sites

  • 7 months later...
  • 1 month later...

1Revenger1

 

Finally have the ECEnabler up.

 

the issue I'm having now, EHO1 is not loading.  XHC is handling both USB2 and USB3

 

attached are some configurations files if you have time to glance at them?

 

Thanks! it is great!

 

ecenabler.png

Screen Shot 2022-02-02 at 11.18.31 PM.png

Screen Shot 2022-02-03 at 9.45.56 PM.png

 

Edited by makk
Link to comment
Share on other sites

  • 3 weeks later...

Greetings @1Revenger1 ,

 

What order should this be in ECEnabler in the Kernel? and what do you recommend the order in ACPI as well for the other SSDT's as I am

not sure where to place it?

 

Where should I put ECEnabler? 

 

I have Lilu, VirtualSMC, ECEnabler, SMCBattery, Whatevergreen, AppleALC, in this order specifically.

ACPI's ssdt_data.aml, SSDT-USB-reset.aml, SSDT-EC-LAPTOP.aml, and then a specific hot patch.

 

I had to understand the renaming scheme that was done originally for Clover.  I was missing the part where there is no need to rename

 the old school way for the new Opencore, Lilu and plugins.  Completely missed the boat.j

 

Thank you for this work! It is truly nice to have! 

 

 

config.plist.zip

Edited by makk
  • Like 1
Link to comment
Share on other sites

Greetings 1Rev,

 

Here are the files.

 

Opencore 0.7.7 Release

Monterey 12.2

SIP Enabled (all)

Gatekeeper Disabled

FileVault disabled

AppleSecureBoot disabled

Took out the VoodooRMI and VoodooSMBus kexts out for the time being


Thank you! Take a look.

 

The SSDT-4x0G2b.aml has SBUS in it from the get go and updated that portion of it using the Patches in MaciASL (Intel Series 9 chipset) from the and added DTGP which was not present.  

 

Originally was on Clover that came with the Project version 4071R which Rehabman modified to work with High Sierra and Mojave. Quite extensive project and has many ASL's.

As mentioned afore, kextstat | grep SMBus  <> reveals IOSMBusFamily, AppleSMBusController

 

Looking at the System DSDT reveals I2CE 

AppleSMBusPCI is not loading.  Should this be loading? If so what is the fix to get it to load?

 

Screen Shot 2022-02-23 at 3.29.38 PM.png

SSDT-4x0G2b.aml.zip config.plist.zip dmesg.txt.zip ACPIlog.txt.zip kernellog.txt.zip MacBook Pro.zip

Edited by makk
Link to comment
Share on other sites

 Share

×
×
  • Create New...