Contribute
Register

[Guide] How to patch DSDT for working battery status

Show output of 'iasl -v' in Terminal.

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20161117-64(RM)
Copyright (c) 2000 - 2016 Intel Corporation
 
Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20161117-64(RM)
Copyright (c) 2000 - 2016 Intel Corporation

Looks fine. Make sure that is the same one being used by MaciASL.

For you to find the reason for the discrepancy I mentioned...
 
Looks fine. Make sure that is the same one being used by MaciASL.

Code:
Josips-MacBook-Pro:Desktop josip$  /Applications/MaciASL.app/Contents/MacOS/iasl61 -v

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20161117-64(RM)
Copyright (c) 2000 - 2016 Intel Corporation
 
Code:
Josips-MacBook-Pro:Desktop josip$  /Applications/MaciASL.app/Contents/MacOS/iasl61 -v

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20161117-64(RM)
Copyright (c) 2000 - 2016 Intel Corporation

It is as I would expect...
 
Update: my battery status works. Looks like the computer needed a EC reset, and the battery needed to recalibrate again.
 
Update: my battery status works. Looks like the computer needed a EC reset, and the battery needed to recalibrate again.

EC reset always needed especially after failed attempts to patch ACPI for battery status...
 
Hey Rehabman, I tried to follow your guide to create a patch for the Cube i7 Book but I'm really at a loss now on what to do now. With your ACPIBatteryManager.kext I get a battery icon, but it always shows 0%. It seems to notice if I switch Power Adapter <-> Battery though, since the text of the popup changes from "Calculating Time Until Full..." (when charging) to "Battery Not Charging" when on battery. It still always says Power Source: Power Adapter.

There is some guy that managed to get battery working on the predecessor (Cube i7 Stylus) and I looked at what he had done to his DSDT and it seems I pretty much did the same.

I really hope you can help me with that one - I attached my patch for you to inspect, too.

Best regards
 

Attachments

  • CLOVER.zip
    2.6 MB · Views: 89
  • output 2.txt.zip
    1.2 KB · Views: 99
  • output.txt.zip
    886 bytes · Views: 88
  • RehabMan.zip
    60.4 KB · Views: 88
  • Strega’s iMac.ioreg.zip
    514.5 KB · Views: 82
  • battery_patch.txt
    2.7 KB · Views: 140
Hey Rehabman, I tried to follow your guide to create a patch for the Cube i7 Book but I'm really at a loss now on what to do now. With your ACPIBatteryManager.kext I get a battery icon, but it always shows 0%. It seems to notice if I switch Power Adapter <-> Battery though, since the text of the popup changes from "Calculating Time Until Full..." (when charging) to "Battery Not Charging" when on battery. It still always says Power Source: Power Adapter.

There is some guy that managed to get battery working on the predecessor (Cube i7 Stylus) and I looked at what he had done to his DSDT and it seems I pretty much did the same.

I really hope you can help me with that one - I attached my patch for you to inspect, too.

Best regards

This patch doesn't make any sense:
Code:
into method label _BIF code_regex \(B1FC\) replaceall_matched begin (X1V0) end;

Must use B1B2. And B1FC was broken into X1F0/X1F1.

Better naming may help you reduce confusion.

There may be other mistakes. Check your work.
 
Yes, you were absolutely right, what a stupid mistake I made there. I renamed all the variables to make them less confusing and replaced the part you pointed out with B1B2(...). This time I didn't replace the registers greater than 8 Bits which aren't used in the DSDT. Still, I have the same issue: 0% charge is shown all the time.

It would be awesome if you could point me in the right direction here. And yeah since I couldn't find information about the Cube i7 Book on the internet, a lot of stuff isn't working yet. I wanted to start adding the battery status first so it would be somewhat good for working even without sound etc.

Thanks in advance,

kim
 

Attachments

  • battery_patch.txt
    2.8 KB · Views: 129
  • CLOVER.zip
    2.6 MB · Views: 107
  • output 2.txt.zip
    1.1 KB · Views: 91
  • output.txt.zip
    928 bytes · Views: 106
  • Strega’s iMac.ioreg.zip
    488.2 KB · Views: 84
  • RehabMan.zip
    60.4 KB · Views: 96
Yes, you were absolutely right, what a stupid mistake I made there. I renamed all the variables to make them less confusing and replaced the part you pointed out with B1B2(...). This time I didn't replace the registers greater than 8 Bits which aren't used in the DSDT. Still, I have the same issue: 0% charge is shown all the time.

It would be awesome if you could point me in the right direction here. And yeah since I couldn't find information about the Cube i7 Book on the internet, a lot of stuff isn't working yet. I wanted to start adding the battery status first so it would be somewhat good for working even without sound etc.

Thanks in advance,

kim

You can see in ioreg that BAT0._STA is returning 0x0b. Should be 0x1f for battery present. So... your DSDT is reporting no battery present.

This is based on BNUM which is set in H_EC._REG based on some calls to ECRD. You could debug this code with ACPIDebug.kext. You might have to rewrite the code to not use ECRD with RefOf... for example this line:
Code:
                    Or (BNUM, ShiftRight (And (ECRD (RefOf (ECWR)), 0x02), One), BNUM)

Can be written:
Code:
                    Or (BNUM, ShiftRight (And (ECWR, 0x02), One), BNUM)

It could be also that previous patches put the EC in a bad state... so make sure you do EC reset.
 
Back
Top