第二步:修改ACPI文件,有两种方法:
方法1.用HotPatch文件“SSDT-BATT.aml”并配置config.plist,配合ACPIBatteryManager.kext正常显示电量
(同机型推荐,方便)
将SSDT-BATT.aml放入EFI/ACPI/patched里,并修改config.plist
SortedOrder加入条目"SSDT-BATT.aml";
DSDT Patches里添加如下patch(具体见附件):
change ADJT to XDJT for Battery Hotpatch
change CLRI to XLRI for Battery Hotpatch
change UPBS to XPBS for Battery Hotpatch
change UPBI to XPBI for Battery Hotpatch
change _BST to XBST for Battery Hotpatch
change SMWR to XMWR for Battery Hotpatch
change SMRD to XMRD for Battery Hotpatch
into method label _BST code_regex If\s+\(LEqual\s+\(BRTE,\s+Zero\)\)\s+\{\s+Store\s+\(0xFFFFFFFF,\s+Index\s+\(PBST,\s+One\)\)\s+\} replaceall_matched begin \n end;
into device label EC0 code_regex BADC,\s+16, replace_matched begin ADC0,8,ADC1,8, end;
into device label EC0 code_regex BFCC,\s+16 replace_matched begin FCC0,8,FCC1,8 end;
into device label EC0 code_regex MCUR,\s+16 replace_matched begin CUR0,8,CUR1,8 end;
into device label EC0 code_regex MBRM,\s+16 replace_matched begin BRM0,8,BRM1,8 end;
into device label EC0 code_regex MBCV,\s+16 replace_matched begin BCV0,8,BCV1,8 end;
into device label EC0 code_regex SMW0,\s+16 replace_matched begin MW00,8,MW01,8 end;
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BADC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.ADC0,\^\^PCI0\.LPCB\.EC0\.ADC1), end;
into method label UPBI code_regex \(\^\^PCI0\.LPCB\.EC0\.BFCC, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.FCC0,\^\^PCI0\.LPCB\.EC0\.FCC1), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MCUR, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.CUR0,\^\^PCI0\.LPCB\.EC0\.CUR1), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BRM0,\^\^PCI0\.LPCB\.EC0\.BRM1), end;
into method label CLRI code_regex \(\^\^LPCB\.EC0\.MBRM, replaceall_matched begin (B1B2(\^\^LPCB\.EC0\.BRM0,\^\^LPCB\.EC0\.BRM1), end;
into method label UPBS code_regex \(\^\^PCI0\.LPCB\.EC0\.MBCV, replaceall_matched begin (B1B2(\^\^PCI0\.LPCB\.EC0\.BCV0,\^\^PCI0\.LPCB\.EC0\.BCV1), end;
into method label SMRD code_regex \(SMW0, replaceall_matched begin (B1B2(MW00,MW00), end;
into method label SMWR code_regex Store\s\(Arg3,\sSMW0\) replaceall_matched begin Store(Arg3, MW00)\nStore(ShiftRight(Arg3,8),MW01) end;
#Deal with the fields more than 32-Bit
into device label EC0 code_regex (SMD0,)\s+(256) replace_matched begin SMDY,%2,//%1%2 0x04 end;
into device label EC0 code_regex (FLD0,)\s+(64) replace_matched begin FLD4,%2,//%1%2 0x04 end;
into device label EC0 code_regex (FLD1,)\s+(128) replace_matched begin FLD5,%2,//%1%2 0x04 end;
into device label EC0 code_regex (FLD2,)\s+(192) replace_matched begin FLD6,%2,//%1%2 0x04 end;
into device label EC0 code_regex (FLD3,)\s+(256) replace_matched begin FLD7,%2,//%1%2 0x04 end;
into method label SMRD code_regex \(FLD0, replaceall_matched begin (RECB(0x04,64), end;
into method label SMRD code_regex \(FLD1, replaceall_matched begin (RECB(0x04,128), end;
into method label SMRD code_regex \(FLD2, replaceall_matched begin (RECB(0x04,192), end;
into method label SMRD code_regex \(FLD3, replaceall_matched begin (RECB(0x04,256), end;
into method label SMWR code_regex Store\s+\((.*),\s+SMD0\) replaceall_matched begin WECB(0x04,256,%1) end;