Contribute
Register

[Guide] How to patch DSDT for working battery status

Sorry, no my modification. I still can't write MaciASL's patches. My way is to use Maciasl as IDE and to patch the code by hands. But I think you can add.

Also there are matching each other patches in the repo: https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Dell-XPS-13.txt and https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Dell-XPS-L502x.txt
maybe you have to merge them.

I would have to see the native DSDT.
 
I have a little bit silly question. Is there a way to find a solution to binpatch the kext ACPIPlatform to obtain a multibyte read/write from/to EmbeddedControl?

I looked at it at one point, and it appears that there is multibyte EC capability already there. But for some reason, it is broken. At one point it worked... in Snow Leopard. Regression, intentional change [with secret handshake], or just a random bug... no way to know.
 
I would have to see the native DSDT.
I have attached the native DSDT especially for that. Few posts upwards. http://www.tonymacx86.com/el-capita...t-working-battery-status-250.html#post1169613

That modification after the patch have been applied:
Code:
                        Name (PAK0, Package (0x0D)
                        {
                            One, 
                            0xFFFFFFFF, 
                            0xFFFFFFFF, 
                            Zero, 
                            0xFFFFFFFF, 
                            Zero, 
                            Zero, 
                            0x64, 
                            Zero, 
                            "Dell", // cosmetic
                            "123456789",  // cosmetic
                            "LiON",  // cosmetic
                            "Dell"  // cosmetic
                        })
Code:
                        Method (_BIF, 0, NotSerialized)  // _BIF: Battery Information
                        {
                            
                            Acquire (^^PCI0.LPCB.EC0.MUT0, 0xFFFF)
                            Store (B1B2(^^PCI0.LPCB.EC0.DCPX,^^PCI0.LPCB.EC0.DCPY), Index (PAK0, One))
                            Store (B1B2(^^PCI0.LPCB.EC0.FCPX,^^PCI0.LPCB.EC0.FCPY), Local0)
                            Store (Local0, Index (PAK0, 0x02))
                            Store (B1B2(^^PCI0.LPCB.EC0.DVTX,^^PCI0.LPCB.EC0.DVTY), Index (PAK0, 0x04))
//                            Store (^^PCI0.LPCB.EC0.DNN0, Local1)
                            Store (B1B2(^^PCI0.LPCB.EC0.BSNX,^^PCI0.LPCB.EC0.BSNY), Local2)
//                            Store (^^PCI0.LPCB.EC0.BCN0, Local3)
//                            Store (^^PCI0.LPCB.EC0.MNN0, Local4)
                            Release (^^PCI0.LPCB.EC0.MUT0)
                            Store (Divide (Local0, 0x0A, Local0), Index (PAK0, 0x05))
                            Store (0x32, Index (PAK0, 0x06))
                            Return (PAK0) /* \_SB_.BAT0.PAK0 */
                        }
And _BST didn't touched, only B1B2 split by the patch.
 
I looked at it at one point, and it appears that there is multibyte EC capability already there. But for some reason, it is broken. At one point it worked... in Snow Leopard. Regression, intentional change [with secret handshake], or just a random bug... no way to know.
Really multibyte EC capability already is there? Is it very hard to disassemble ACPIPlatform in IDE and to find a solution to fix that silly bug?
 
Hi, RehabMan!

Dell XPS 13 patch also matches Dell Vostro 3750 lappy. https://github.com/RehabMan/Laptop-DSDT-Patch/blob/master/battery/battery_Dell-XPS-13.txt

Only one thing: in the code there are some math issues and no Critical capacity positive number. Maybe fix it in the repo, plz!
Example:
original
Code:
Store (Divide (Local0, 0x0A, ), Index (PAK0, 0x05)) // <<--- Nowhere to divide Local0.
Store (Zero, Index (PAK0, 0x06)) // <<<---- Zero Critical capacity
should be
Code:
Store (Divide (Local0, 0x0A, Local0), Index (PAK0, 0x05))
Store (0x32, Index (PAK0, 0x06)) // <<<--- I think 50 mAh for Critical capacity is OK

Origin DSDT.aml attached

Looking at the full DSDT, the zero critical capacity looks intentional. It is not invalid, as there may be some battery reserve when a zero reading is reached.

I tend not to second guess the code provided by the OEM.
 
Really multibyte EC capability already is there? Is it very hard to disassemble ACPIPlatform in IDE and to find a solution to fix that silly bug?

The code is deep and complex, so determining the root of the problem is difficult.

It would be easier if the the source was provided...
 
It would be easier if the the source was provided...
Only if anyone of insiders could provide a source code for us.
So can you add Dell Vostro 3750 to Dell XPS 13 patch? And merge it with Dell-XPS-L502x.txt
 
Only if anyone of insiders could provide a source code for us.
So can you add Dell Vostro 3750 to Dell XPS 13 patch? And merge it with Dell-XPS-L502x.txt

Although the patches are the same, I can't merge them at this point. There may be guides that refer to either name, and so merging them to one patch file would invalidate the guide/reference.

Note: Added a comment for Dell Vostro 3750.
 
Screen Shot 2015-12-19 at 5.49.11 AM.png

Hi Rehabman,, i have Sony Vaio SVE14A25CVW. I used latest ACPIBatteryManager.kext. But, at 79% the battery stop charging.

I have patched PNOT, IRQ, OSX Check for Windows 8, Zero Mutex. But i don't see Battery Patch for this model. Can you take a look at my DSDT. I have no advance experience about thist battery patch manual. I upload my DSDT View attachment DSDT.aml
 
Back
Top