Since apple changes some things on lion, the Appleacpibatterymanager does't work any more under the Lion, so people use roll backed next to get is work, but this has shortage. At the first, bcc9 found that lion reads battery info from EC by 8bit, and most laptop's EC region use 16bit to store battery information, so the legacy driver doesn't work include voodoo battery. This information is important for next.
The guy zenglg1977 takes some time to rewrite the sources code of Appleacpibatterymanager to make it work for lion. It is needed to edit the code of battery in the dsdt, so divide 16bit register into two 8bit can make sense. Like:
Before
//
Field (RAM, ByteAcc, Lock, Preserve)
{
Offset (0xE0),
BSDC, 16,
BSDV, 16,
BSSN, 16
}
//
Later
//
Field (RAM, ByteAcc, Lock, Preserve)
{
Offset (0xE0),
SDC0, 8,
SDC1, 8,
SDV0, 8,
SDV1, 8,
SSN0, 8,
SSN1, 8
}
//
then, the transmit part can be done like this:For example:
Before: Multiply (BSDC, 0x0A, Local1) Later: Multiply (SDC1, 0x100, Local1) Add (SDC0, Local1, Local1) Multiply (Local1, 0x0A, Local1) Before: Store (BSDC, Local1) Later: Multiply (SDC1, 0x100, Local1) Add (SDC0, Local1, Local1)
This way created by zenglg1977, after done with this can make it work.
But when compare VIVXIX with others method, i found his method is simple and easy to reach, it named "B1B2".
Here is his method:
1, create the "Method (B1B2, 2, NotSerialized)" as global:
Method (B1B2, 2, NotSerialized)
{
Or (ShiftLeft(Arg1,0x08), Arg0, Local0)
Return (Local0)
} //for 16bit
Method (B1B4, 4, NotSerialized)
{
Or (ShiftLeft(Arg1,0x08), Arg0, Local0)
Or (ShiftLeft(Arg2,0x10), Local0, Local0)
Or (ShiftLeft(Arg3,0x18), Local0, Local0)
Return (Local0)
} //for 32bit
Method (L1L4, 4, NotSerialized)//32*4=128
{
Or (ShiftLeft(Arg1,0x20), Arg0, Local0)
Or (ShiftLeft(Arg2,0x40), Local0, Local0)
Or (ShiftLeft(Arg3,0x60), Local0, Local0)
Return (Local0)
}//for 128bit
2, change the 16bit register into two 8bit register, like:
//BPV0, SPV0, 8, SPV1, 8,3, here is some collections of example editing work he finished before.
A:
//Store (^^EC0.BAC0, Local5) Store (B1B2(^^EC0.SAC0,^^EC0.SAC1), Local5)
B:
//Store (^^EC0.BDC0, Index (STAT, One)) Store (B1B2(^^EC0.SDC0,^^EC0.SDC1), Index (STAT, One))
C:
//Multiply (BGU1, BFC1 ,Local2) Multiply (BGU1, B1B2 (BFC0, BFC1), Local2)
Some special parts as below:
D:
//If (^^EC0.BDC0 ) If (B1B2(^^EC0.SDC0,^^EC0.SDC1))
E:
//If (LGreater (^^EC0.BAC0, 0xFB00)) If (LGreater (B1B2(^^EC0.SAC0,^^EC0.SAC1), 0xFB00)
F:
//Store (^^EC0.BDC0, BFC1) Store (^^EC0.SDC1, BFC1) Sleep (0x14) Store (^^EC0.SDC0, BFC0)
More about the sources code, zenglg1977 combines gsly's AppleSmartBatteryManger code into whole project, then people get two choice. And weizh126 plays a trick about battery cycle count in the _BIF method part, the _BIF just contains 13 items in the package and he adds "Zero" to it become 14, and store the cycle count register info in it, it sounds illegal, but it works.
Last, here is the sources code and attachments.
AppleBatteryManager_src.zip 72.32K
286 downloads
AppleACPIBatteryManager.kext.zip 30.93K
670 downloads
AppleSmartBatteryManager.kext.zip 34.52K
660 downloadsUpdate for 10.7.3
AppleBatteryManager_src.zip 72.32K
342 downloads
AppleSmartBatteryManager.kext.zip 35.13K
901 downloads
AppleACPIBatteryManager.kext.zip 35.14K
770 downloadsAlso screenshots:
Screen_Shot_2011_11_21_at_12.41.24_AM.png 63.99K
910 downloads
Screen_Shot_2011_11_21_at_12.41.47_AM.png 30.83K
684 downloadsOriginal link address:
http://bbs.pcbeta.co...935509-1-1.html
http://bbs.pcbeta.co...935582-1-1.html



Sign In
Create Account










