本帖最后由 劳维明 于 2013-7-1 10:12 编辑
经过多次反复修改dsdt.aml
成功利用AppleACPIBatteryManager.kext显示电池信息
AppleACPIBatteryManager.kext.zip
(39.42 KB, 下载次数: 282)
并加载1.7版AppleACPIPlatform.kext
(1.7原版)AppleACPIPlatform.kext.zip
(216.07 KB, 下载次数: 214)
在Device (BAT0)下,根据^^PCI0.LPC.EC0.找到下面几个不是8字节的:
DSCP, 16,
Offset (0x74),
DSVG, 16,
Offset (0x77),
MCUR, 16,
MBRM, 16,
MBCV, 16,
Offset (0xA0),
VERN, 32,
Offset (0xCF),
首先dsdt开头添加Method
- Method (B1B2, 2, NotSerialized)//8*2=16
- {
- Or (ShiftLeft (Arg1, 0x08), Arg0, Local0)
- Return (Local0)
- }
- Method (B1B4, 4, NotSerialized)///8*4=32
- {
- Or (ShiftLeft (Arg1, 0x08), Arg0, Local0)
- Or (ShiftLeft (Arg2, 0x10),Local0, Local0)
- Or (ShiftLeft (Arg3, 0x18),Local0, Local0)
- Return (Local0)
- }
- 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)
- }
- Method (L1L6, 6, NotSerialized)//32*6=192
- {
- Or (ShiftLeft (Arg1, 0x20), Arg0, Local0)
- Or (ShiftLeft (Arg2, 0x40),Local0, Local0)
- Or (ShiftLeft (Arg3, 0x60),Local0, Local0)
- Or (ShiftLeft (Arg4, 0x80),Local0, Local0)
- Or (ShiftLeft (Arg5, 0xA0),Local0, Local0)
- Return (Local0)
- }
- Method (D2D4, 2, NotSerialized)//128*2=256
- {
- Or (ShiftLeft (Arg1, 0x80), Arg0, Local0)
- Return (Local0)
- }
复制代码
第一个:DSCP
SCP0, 8,
SCP1, 8,
//Store (^^PCI0.LPC.EC0.DSCP, Index (PBIF, One))
Store (B1B2(^^PCI0.LPC.EC0.SCP0,^^PCI0.LPC.EC0.SCP1), Index (PBIF, One))
//If (LLess (^^PCI0.LPC.EC0.DSCP, 0x1194))
If (LLess (B1B2(^^PCI0.LPC.EC0.SCP0,^^PCI0.LPC.EC0.SCP1), 0x1194))
第二个:DSVG
SVG0, 8,
SVG1, 8,
//Store (^^PCI0.LPC.EC0.DSVG, Index (PBIF, 0x04))
Store (B1B2(^^PCI0.LPC.EC0.SVG0,^^PCI0.LPC.EC0.SVG1), Index (PBIF, 0x04))
第三个:MCUR
CUR0, 8,
CUR1, 8,
//Store (^^PCI0.LPC.EC0.MCUR, Local5)
Store (B1B2(^^PCI0.LPC.EC0.CUR0,^^PCI0.LPC.EC0.CUR1), Local5)
第四个:MBRM
BRM0, 8,
BRM1, 8,
//Store (^^PCI0.LPC.EC0.MBRM, Local5)
Store (B1B2(^^PCI0.LPC.EC0.BRM0,^^PCI0.LPC.EC0.BRM1), Local5)
第五个:MBCV
BCV0, 8,
BCV1, 8,
//Store (^^PCI0.LPC.EC0.MBCV, Index (PBST, 0x03))
Store (B1B2(^^PCI0.LPC.EC0.BCV0,^^PCI0.LPC.EC0.BCV1), Index (PBST, 0x03))
最后一个:VERN
VER0, 8,
VER1, 8,
VER2, 8,
VER3, 8,
Offset (0xCF),
//Store (^^EC0.VERN, Local0)
Store (B1B4 (^^EC0.VER0, ^^EC0.VER1, ^^EC0.VER2, ^^EC0.VER3), Local0)
然后按照此帖
https://bbs.pcbeta.com/viewthread-937628-1-1.html
对照自己的dsdt中一样的并且不是8字节的来修改:
“//”后面是原代码,下一行是修改后代码。
//P80D, 32,
P8D0, 8,
P8D1, 8,
P8D2, 8,
P8D3, 8,
//这个和下面对应的可能不用修改,原帖没有
//CSTE, 16,
CST0, 8,
CST1, 8,
//这个和下面对应的可能不用修改,原帖没有
//NSTE, 16,
NST0, 8,
NST1, 8,
//Store (Or (And (P80D, 0xFFFFFF00), Arg1), P80D)
Store (Arg1, P8D0)
//Store (Or (And (P80D, 0xFFFF00FF), ShiftLeft (Arg1, 0x08)
Store (Arg1, P8D1)
//Store (Or (And (P80D, 0xFF00FFFF), ShiftLeft (Arg1, 0x10)
Store (Arg1, P8D2)
//Store (Or (And (P80D, 0x00FFFFFF), ShiftLeft (Arg1, 0x18)
Store (Arg1, P8D3)
//Store (P80D, P80H)
Store (P8D0, P80H)
Store (P8D1, P80H)
Store (P8D2, P80H)
Store (P8D3, P80H)
//这个可能不用修改
//Store (NSTE, CSTE)
Store (NST0, CST0)
Store (NST1, CST1)
//SMD0, 256,
SM00, 8,
SM01, 8,
SM02, 8,
SM03, 8,
SM04, 8,
SM05, 8,
SM06, 8,
SM07, 8,
SM08, 8,
SM09, 8,
SM10, 8,
SM11, 8,
SM12, 8,
SM13, 8,
SM14, 8,
SM15, 8,
SM16, 8,
SM17, 8,
SM18, 8,
SM19, 8,
SM20, 8,
SM21, 8,
SM22, 8,
SM23, 8,
SM24, 8,
SM25, 8,
SM26, 8,
SM27, 8,
SM28, 8,
SM29, 8,
SM30, 8,
SM31, 8,
//SMW0, 16
SMW0, 8,
SMW1, 8
//FLD0, 64
DL00, 8,
DL01, 8,
DL02, 8,
DL03, 8,
DL04, 8,
DL05, 8,
DL06, 8,
DL07, 8,
//FLD1, 128
DL10, 8,
DL11, 8,
DL12, 8,
DL13, 8,
DL14, 8,
DL15, 8,
DL16, 8,
DL17, 8,
DL18, 8,
DL19, 8,
DL1A, 8,
DL1B, 8,
DL1C, 8,
DL1D, 8,
DL1E, 8,
DL1F, 8,
//FLD2, 192
DL20, 8,
DL21, 8,
DL22, 8,
DL23, 8,
DL24, 8,
DL25, 8,
DL26, 8,
DL27, 8,
DL28, 8,
DL29, 8,
DL2A, 8,
DL2B, 8,
DL2C, 8,
DL2D, 8,
DL2E, 8,
DL2F, 8,
DL2G, 8,
DL2H, 8,
DL2I, 8,
DL2J, 8,
DL2K, 8,
DL2L, 8,
DL2M, 8,
DL2N, 8,
//FLD3, 256
DL30, 8,
DL31, 8,
DL32, 8,
DL33, 8,
DL34, 8,
DL35, 8,
DL36, 8,
DL37, 8,
DL38, 8,
DL39, 8,
DL3A, 8,
DL3B, 8,
DL3C, 8,
DL3D, 8,
DL3E, 8,
DL3F, 8,
DL3G, 8,
DL3H, 8,
DL3I, 8,
DL3J, 8,
DL3K, 8,
DL3L, 8,
DL3M, 8,
DL3N, 8,
DL3O, 8,
DL3P, 8,
DL3Q, 8,
DL3R, 8,
DL3S, 8,
DL3T, 8,
DL3U, 8,
DL3V, 8,
//Store (SMW0, Arg3)
Store (B1B2(SMW0,SMW1), Arg3)
//Store (FLD0, Local2)
Store (L1L4(B1B2(DL00,DL01), B1B2(DL02,DL03), B1B2(DL04,DL05), B1B2(DL06,DL07)), Local2)
//Store (FLD1, Local2)
Store (L1L4(B1B4(DL10,DL11,DL12,DL13),B1B4(DL14,DL15,DL16,DL17),B1B4(DL18,DL19,DL1A,DL1B),B1B4(DL1C,DL1D,DL1E,DL1F)), Local2)
//Store (FLD2, Local2)
Store (L1L6(B1B4(DL20,DL21,DL22,DL23),B1B4(DL24,DL25,DL26,DL27),B1B4(DL28,DL29,DL2A,DL2B),B1B4(DL2C,DL2D,DL2E,DL2F),B1B4(DL2G,DL2H,DL2I,DL2J),B1B4(DL2K,DL2L,DL2M,DL2N)), Local2)
//Store (FLD3, Local2)
Store (D2D4(L1L4(B1B4(DL30,DL31,DL32,DL33),B1B4(DL34,DL35,DL36,DL37),B1B4(DL38,DL39,DL3A,DL3B),B1B4(DL3C,DL3D,DL3E,DL3F)),L1L4(B1B4(DL3G,DL3H,DL3I,DL3J),B1B4(DL3K,DL3L,DL3M,DL3N),B1B4(DL3O,DL3P,DL3Q,DL3R),B1B4(DL3S,DL3T,DL3U,DL3V))), Local2)
//GBFE (Local2, Local5, RefOf (Local6))
If (LEqual (Local5, 0x00)) { Store (SM00, Local6) }
If (LEqual (Local5, 0x01)) { Store (SM01, Local6) }
If (LEqual (Local5, 0x02)) { Store (SM02, Local6) }
If (LEqual (Local5, 0x03)) { Store (SM03, Local6) }
If (LEqual (Local5, 0x04)) { Store (SM04, Local6) }
If (LEqual (Local5, 0x05)) { Store (SM05, Local6) }
If (LEqual (Local5, 0x06)) { Store (SM06, Local6) }
If (LEqual (Local5, 0x07)) { Store (SM07, Local6) }
If (LEqual (Local5, 0x08)) { Store (SM08, Local6) }
If (LEqual (Local5, 0x09)) { Store (SM09, Local6) }
If (LEqual (Local5, 0x0A)) { Store (SM10, Local6) }
If (LEqual (Local5, 0x0B)) { Store (SM11, Local6) }
If (LEqual (Local5, 0x0C)) { Store (SM12, Local6) }
If (LEqual (Local5, 0x0D)) { Store (SM13, Local6) }
If (LEqual (Local5, 0x0E)) { Store (SM14, Local6) }
If (LEqual (Local5, 0x0F)) { Store (SM15, Local6) }
If (LEqual (Local5, 0x10)) { Store (SM16, Local6) }
If (LEqual (Local5, 0x11)) { Store (SM17, Local6) }
If (LEqual (Local5, 0x12)) { Store (SM18, Local6) }
If (LEqual (Local5, 0x13)) { Store (SM19, Local6) }
If (LEqual (Local5, 0x14)) { Store (SM20, Local6) }
If (LEqual (Local5, 0x15)) { Store (SM21, Local6) }
If (LEqual (Local5, 0x16)) { Store (SM22, Local6) }
If (LEqual (Local5, 0x17)) { Store (SM23, Local6) }
If (LEqual (Local5, 0x18)) { Store (SM24, Local6) }
If (LEqual (Local5, 0x19)) { Store (SM25, Local6) }
If (LEqual (Local5, 0x1A)) { Store (SM26, Local6) }
If (LEqual (Local5, 0x1B)) { Store (SM27, Local6) }
If (LEqual (Local5, 0x1C)) { Store (SM28, Local6) }
If (LEqual (Local5, 0x1D)) { Store (SM29, Local6) }
If (LEqual (Local5, 0x1E)) { Store (SM30, Local6) }
If (LEqual (Local5, 0x1F)) { Store (SM31, Local6) }
//Store (Arg3, SMD0)
Store (SizeOf (Arg3), Local3)
And (Local3, 0x1F, Local3)
Store (Arg3, Local4)
Store (Zero, Local5)
While (LGreater (Local3, Local5))
{
GBFE (Local4, Local5, RefOf (Local6)) //不知是local4还是local2
If (LEqual (Local5, 0x00)) { Store (Local6, SM00) }
If (LEqual (Local5, 0x01)) { Store (Local6, SM01) }
If (LEqual (Local5, 0x02)) { Store (Local6, SM02) }
If (LEqual (Local5, 0x03)) { Store (Local6, SM03) }
If (LEqual (Local5, 0x04)) { Store (Local6, SM04) }
If (LEqual (Local5, 0x05)) { Store (Local6, SM05) }
If (LEqual (Local5, 0x06)) { Store (Local6, SM06) }
If (LEqual (Local5, 0x07)) { Store (Local6, SM07) }
If (LEqual (Local5, 0x08)) { Store (Local6, SM08) }
If (LEqual (Local5, 0x09)) { Store (Local6, SM09) }
If (LEqual (Local5, 0x0A)) { Store (Local6, SM10) }
If (LEqual (Local5, 0x0B)) { Store (Local6, SM11) }
If (LEqual (Local5, 0x0C)) { Store (Local6, SM12) }
If (LEqual (Local5, 0x0D)) { Store (Local6, SM13) }
If (LEqual (Local5, 0x0E)) { Store (Local6, SM14) }
If (LEqual (Local5, 0x0F)) { Store (Local6, SM15) }
If (LEqual (Local5, 0x10)) { Store (Local6, SM16) }
If (LEqual (Local5, 0x11)) { Store (Local6, SM17) }
If (LEqual (Local5, 0x12)) { Store (Local6, SM18) }
If (LEqual (Local5, 0x13)) { Store (Local6, SM19) }
If (LEqual (Local5, 0x14)) { Store (Local6, SM20) }
If (LEqual (Local5, 0x15)) { Store (Local6, SM21) }
If (LEqual (Local5, 0x16)) { Store (Local6, SM22) }
If (LEqual (Local5, 0x17)) { Store (Local6, SM23) }
If (LEqual (Local5, 0x18)) { Store (Local6, SM24) }
If (LEqual (Local5, 0x19)) { Store (Local6, SM25) }
If (LEqual (Local5, 0x1A)) { Store (Local6, SM26) }
If (LEqual (Local5, 0x1B)) { Store (Local6, SM27) }
If (LEqual (Local5, 0x1C)) { Store (Local6, SM28) }
If (LEqual (Local5, 0x1D)) { Store (Local6, SM29) }
If (LEqual (Local5, 0x1E)) { Store (Local6, SM30) }
If (LEqual (Local5, 0x1F)) { Store (Local6, SM31) }
Increment (Local5)
}
Store (And (Local3, 0x1F), BCNT)
//Store (NSTE, Local3)
Store (NST0, Local3)
Store (NST1, Local3)
//Store (NSTE, P80H)
Store (NST0, P80H)
Store (NST1, P80H)
//Store (SMW0, Arg3)
Store (B1B2 (SMW0, SMW1), Arg3)
//Store (FLD0, Local2)
Store (L1L4 (B1B2 (DL00, DL01), B1B2 (DL02, DL03), B1B2 (DL04,DL05), B1B2 (DL06, DL07)), Local2)
//Store (FLD1, Local2)
Store (L1L4 (B1B4 (DL10, DL11, DL12, DL13), B1B4 (DL14, DL15, DL16, DL17), B1B4 (DL18, DL19, DL1A, DL1B), B1B4 (DL1C, DL1D, DL1E, DL1F)), Local2)
//Store (FLD2, Local2)
Store (L1L6 (B1B4 (DL20, DL21, DL22, DL23), B1B4 (DL24, DL25, DL26, DL27), B1B4 (DL28, DL29, DL2A, DL2B), B1B4 (DL2C, DL2D, DL2E, DL2F), B1B4 (DL2G, DL2H, DL2I, DL2J), B1B4 (DL2K, DL2L, DL2M, DL2N)), Local2)
//Store (FLD3, Local2)
Store (D2D4 (L1L4 (B1B4 (DL30, DL31, DL32, DL33), B1B4 (DL34, DL35, DL36, DL37), B1B4 (DL38, DL39, DL3A, DL3B), B1B4 (DL3C, DL3D, DL3E, DL3F)), L1L4 (B1B4 (DL3G, DL3H, DL3I, DL3J), B1B4 (DL3K, DL3L, DL3M, DL3N), B1B4 (DL3O, DL3P, DL3Q, DL3R), B1B4 (DL3S, DL3T, DL3U, DL3V))), Local2)
修改完成以上代码后,编译保存,放到E\E。
把1.7版的AppleACPIPlatform.kext和AppleACPIBatteryManager.kext放在S\L\E
用Kext Utility重建缓存修复权限。重启。
大功告成!
注意:以上代码仅供参考,可能没找全或有错,请对照原帖修改即可。
先提供没修改电池代码(其它地方已修改)的dsdt
dsdt_nobattery.aml.zip
(18.1 KB, 下载次数: 33)
能上1.7版AppleACPIPlatform.kext和显示电池信息的dsdt
dsdt_Battery.aml.zip
(19.03 KB, 下载次数: 85)
我的机型是:HASEE HP650 D6
加了expresscard to USB3.0和更换了无线网卡AR9380 450M版和1T 日立硬盘。
保修时给换了LED屏(原CCFL)
|