Contribute
Register

[Guide] How to patch DSDT for working battery status

Thanks.
I did suppose you were telling me this.
But if I do install FakeSMC in LE no boot, and keeping a copy of it in CKO (and one in LE), no keyboard (with your PS2) and no more I2C TP. Can be APFS+?

Will move the rest of them.

Will try to do a fresh installation on HFS+J.

Can you confirm battery patching is OK?

Thanks

Keep in mind that *all kexts you need* must be installed to the system volume (properly, to /L/E) when you transition to FakeSMC.kext being installed. Kexts you have in EFI/Clover/kexts will not be injected after you install FakeSMC.kext (due to config.plist/SystemParameters/InjectKexts="Detect").
 
Thank you.
Moved to HFS+, moved everything away from Clover kext and all in /L/E, but still no luck.
Now no changes if I disconnect plug always think it under charge.
What I'm missing?
 

Attachments

  • debug_27718.zip
    1.1 MB · Views: 73
Thank you.
Moved to HFS+, moved everything away from Clover kext and all in /L/E, but still no luck.
Now no changes if I disconnect plug always think it under charge.
What I'm missing?

The ioreg you attached shows battery fully charged (CurrentCapacity is same as MaxCapacity), and laptop currently powered by AC adapter.
Are you saying it is inaccurate?
 
Yes it is not working but I think is something to do with updating the status in menu bar.
If I unplug the charger, status think it is still charging, no screen dimming, no sleep, nothing. Unplugged no sign of discharging.

But if I do open the Energy saver in SP and I touch anything in there for example the dim checkbox or I do unplug the power it switch between Battery an PA and start working but whiteout updating the icon status on the menu bar: start dimming the display, and plugging back move to the PA tab and undim the screen, etc.

On following boot even if the Show battery status is checked no status in menu bar. Need to go back to SP and Energy.

So I suppose, even from the messages in log, kext it is working but need a kick to start even if status it is not updated. For example even using the laptop unplugged status remains alway at 100% solid white batt icon even if naturally it use them.

After kicking it sleep works, etc.

Thanks
 
Yes it is not working but I think is something to do with updating the status in menu bar.
If I unplug the charger, status think it is still charging, no screen dimming, no sleep, nothing. Unplugged no sign of discharging.

But if I do open the Energy saver in SP and I touch anything in there for example the dim checkbox or I do unplug the power it switch between Battery an PA and start working but whiteout updating the icon status on the menu bar: start dimming the display, and plugging back move to the PA tab and undim the screen, etc.

On following boot even if the Show battery status is checked no status in menu bar. Need to go back to SP and Energy.

So I suppose, even from the messages in log, kext it is working but need a kick to start even if status it is not updated. For example even using the laptop unplugged status remains alway at 100% solid white batt icon even if naturally it use them.

After kicking it sleep works, etc.

Thanks

You need to check in ioreg as you unplug/re-plug.
Also can be useful to use the debug ACPIBatteryManager.kext and check the kernel logs so you can see what ACPI _BIF is returning.
 
Will do.
I'm already using the debug versione of your kext.
Also I've booted from an external (fresh) Sierra (10.12.6) and it is acting the same.

Once you start touching something about batteries it starts: seems it need something to "activate" the battery and from that point on seems to act as should be.
Here battery % is shown and seems to work (after the initial kick).

Can be something wrong in the modded DSDT?

I'll let you know
Thanx
 
Will do.
I'm already using the debug versione of your kext.
Also I've booted from an external (fresh) Sierra (10.12.6) and it is acting the same.

Once you start touching something about batteries it starts: seems it need something to "activate" the battery and from that point on seems to act as should be.
Here battery % is shown and seems to work (after the initial kick).

Can be something wrong in the modded DSDT?

I'll let you know
Thanx

You need to analyze the debug output and ioreg to determine the source of the problem.
 
Hi RehabMan.
If you can give a clue on my test please.
Tested on debug kext.
What is happening is this.
On boot the batteries check does not start. I need to "force" it to wake/start working.
Even with power unplugged at boot the status % remain always at 100 (or whatever it is) and only playing with Energy Saver specially the Dim display checkbox start working. And it using, being unplugged, the powered conf in ES a not the battery one.
The sooner it starts everything seems to work OK: the % start decreasing or increasing on charge, the display dims or undims, it applies correct config being or on on batteries or plugged etc.

What I see in the log.
The first thing I notice is:
ACPIBatteryManager: clearBatteryState: do_update = false
this at boot. I do not know if this does not start the battery checking.
There is a way to force this to true if it has any meaning? Checked config.plist in the kext with no luck.

Also I can find this:
ACPIBatteryManager: entering addBatteryManager(<private>)
{"restrictedMode":false,"pushServiceConnected":false,"batteryData":{"wasConnected":false,"charged":false,"level":-1,"connected":false,"chargerType":"kChargerTypeUnknown"},"thermalLevel":-1,"batterySaverModeEnabled":false,"reachability":"kReachabilityLarge","airplaneMode":false}

where kChargerTypeUnknown can be something wrong?

The ACPI_BIF it is alway 13 plugging or unplugging the power:
ACPIBatteryManager: setBatteryBIF: acpibat_bif size = 13
Doe not change in any case. Also in the log state changing (plugged or not)clearly generates log but with no big changes in the fields logged.

So what I suppose that for some reason battery status does not start at boot and I need to force starting it.
After that it is working OK.
 
Hi RehabMan.
If you can give a clue on my test please.
Tested on debug kext.
What is happening is this.
On boot the batteries check does not start. I need to "force" it to wake/start working.
Even with power unplugged at boot the status % remain always at 100 (or whatever it is) and only playing with Energy Saver specially the Dim display checkbox start working. And it using, being unplugged, the powered conf in ES a not the battery one.
The sooner it starts everything seems to work OK: the % start decreasing or increasing on charge, the display dims or undims, it applies correct config being or on on batteries or plugged etc.

What I see in the log.
The first thing I notice is:
ACPIBatteryManager: clearBatteryState: do_update = false
this at boot. I do not know if this does not start the battery checking.
There is a way to force this to true if it has any meaning? Checked config.plist in the kext with no luck.

Also I can find this:
ACPIBatteryManager: entering addBatteryManager(<private>)
{"restrictedMode":false,"pushServiceConnected":false,"batteryData":{"wasConnected":false,"charged":false,"level":-1,"connected":false,"chargerType":"kChargerTypeUnknown"},"thermalLevel":-1,"batterySaverModeEnabled":false,"reachability":"kReachabilityLarge","airplaneMode":false}

where kChargerTypeUnknown can be something wrong?

The ACPI_BIF it is alway 13 plugging or unplugging the power:
ACPIBatteryManager: setBatteryBIF: acpibat_bif size = 13
Doe not change in any case. Also in the log state changing (plugged or not)clearly generates log but with no big changes in the fields logged.

So what I suppose that for some reason battery status does not start at boot and I need to force starting it.
After that it is working OK.

I don't know what you mean by "batteries check does not start".
 
Hi RehabMan.
I tried to make a patch for my ThinkPad P51. There's only one 16-bit data to change but after I installed the patched DSDT and reboot, macOS failed to get the battery status.
I think it is an error of the original DSDT (Near the GetBatterySTatus part). When I toggle the battery icon, the Console.app shows an error about AppleACPIPlatform (
[\_SB.PCI0.LPCB.EC.BAT0._BST] (Node ffffff804365ad20) ),
but I don't know how to fix it.
Please take a look at all the files. There's a README file in the zip.
Than you so much for your effort!
 

Attachments

  • Debug.zip
    3.1 MB · Views: 87
Back
Top