Contribute
Register

Battery Manager with Fix for Boot without Batteries

Status
Not open for further replies.
This is a raw dump from Ubuntu that I have a backup of. I've attached it below.
 

Attachments

  • DSDT.dsl.zip
    59.8 KB · Views: 81
This is a raw dump from Ubuntu that I have a backup of. I've attached it below.

In the _BIX method there has access to 16-bit field B0C3. I fixed it with additional patches below (also fixed B1C3 just in case there is a BAT1 device for a second battery) in some DSDTs:

Code:
# additional work for _BIX method present in some ASUS laptops

into device label EC0 code_regex B0C3,\s+16 replace_matched begin XC30,8,XC31,8 end;
into device label EC0 code_regex B1C3,\s+16 replace_matched begin YC30,8,YC31,8 end;
into_all method label _BIX code_regex \(\^\^LPCB\.EC0\.B0C3, replaceall_matched begin (B1B2(^^LPCB.EC0.XC30,^^LPCB.EC0.XC31), end;
into_all method label _BIX code_regex \(\^\^LPCB\.EC0\.B1C3, replaceall_matched begin (B1B2(^^LPCB.EC0.YC30,^^LPCB.EC0.YC31), end;

If that doesn't work (I think it will), try removing the _BIX method. This will cause the battery manager to use _BIF instead of _BIX (_BIX code is a bit untested...)

Code:
into_all method label _BIX remove_entry;

Hopefully it works with the patched _BIX in place, as it helps validate code that is already in the kext...
 
Part of the issue is your DSDT is reporting three batteries active. I assume your laptop only has one, probably the first one (BAT0) in DSDT, and the battery kext has only been tested with one battery anyway... So I would disable the others:

Code:
into method _STA parent label BAT1 replace_content begin Return (Zero) end;
into method _STA parent label BAT2 replace_content begin Return (Zero) end;

See how that works out...

BTW: I assume the DSDT you posted is unedited (at least with respect to battery/EC)?

With NoCaches works great, I do not understand where the problem is.
 

Attachments

  • Boot-Messages.txt.zip
    3.2 KB · Views: 72
The 16bit to 8bit conversion in _BIX did the trick (I did not remove the _BIX method). My battery is now correctly reporting the percentage. My serial and battery information are now being correctly displayed.
 
With NoCaches works great, I do not understand where the problem is.

You mean if you boot without kernel cache "-f" things work, but if you boot w/ kernel cache (no "-f" and UseKernelCache=Yes in boot.plist) they don't?

If so, you probably have some incompatible kexts or something...

Do a repair permissions from Disk Utility. After that, do kext cache rebuild (use Kext Wizard) and keep an eye on system.log from console while doing the rebuild. Note any errors.

- - - Updated - - -

The 16bit to 8bit conversion in _BIX did the trick (I did not remove the _BIX method). My battery is now correctly reporting the percentage. My serial and battery information are now being correctly displayed.

Great. Nice to hear you have it working...
 
wow...
now it is shown 100% in my Thinkpad T430.
the serial number is not correctly shown, but not a bigdeal to me.

thanks rehabman.
great work!
 
wow...
now it is shown 100% in my Thinkpad T430.
the serial number is not correctly shown, but not a bigdeal to me.

Serial# is probably a DSDT issue -- some people skip it when making DSDT patches. But yeah, not really something to worry about.
 
Status
Not open for further replies.
Back
Top