Contribute
Register

[Guide] Patching LAPTOP DSDT/SSDTs

Hello RehabMan,

I have question regarding AML files decompiled with the IASL you linked to in your guide. I followed everything exactly as the guide says. Your statement regarding never to open an AML in MAcIASL and to always decompile with IASL first then use the DSL generated file with MacIASL. Your main reason was for difficult errors to handle but mostly for External References am I correct?

What I have found with the IASL is a strange way it handles Operands such as the Store, If, And, Or etc etc. Something seems odd with the way IASL handles this compared to MacIASL. MacIASL handles this quite well actually.

This example below shows IASL strips the "And" where the MacIASL does not. I have to re-write my Logical "And" error fix patch because of this as one example only. The IASL DSL DSDT in the example below has stripped out the "And". Wouldn't it be more difficult to fix these errors over Externals especially when you can have so many operands in a DSDT, that could be a very complex thing to fix/handle (patches)?


Examples:


AML File opened directly in MacIASL:


Code:
    Scope (\_SB.PCI0)    {
        Name (SUPP, 0x00)
        Name (CTRL, 0x00)
        Method (_OSC, 4, NotSerialized)  // _OSC: Operating System Capabilities
        {
            If (LEqual (Arg0, ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
            {
                CreateDWordField (Arg3, 0x00, CDW1)
                CreateDWordField (Arg3, 0x04, CDW2)
                CreateDWordField (Arg3, 0x08, CDW3)
                Store (CDW2, SUPP)
                Store (CDW3, CTRL)
                If (LNotEqual (And (SUPP, 0x16), 0x16))
                {
                    And (CTRL, 0x1E)
                }


DSL Decompiled with IASL:

Code:
    Scope (\_SB.PCI0)    {
        Name (SUPP, 0x00)
        Name (CTRL, 0x00)
        Method (_OSC, 4, NotSerialized)  // _OSC: Operating System Capabilities
        {
            If ((Arg0 == ToUUID ("33db4d5b-1ff7-401c-9657-7441c03dd766") /* PCI Host Bridge Device */))
            {
                CreateDWordField (Arg3, 0x00, CDW1)
                CreateDWordField (Arg3, 0x04, CDW2)
                CreateDWordField (Arg3, 0x08, CDW3)
                SUPP = CDW2
                CTRL = CDW3
                If (((SUPP & 0x16) != 0x16))
                {
                    (CTRL & 0x1E)
                }

Nothing strange there. New version of iasl supports "C" style operands, both in the compiler and disassembler.

You failed to use the "-dl" flag as recommended in the guide.
 
Very sorry my mistake "and" is now present with both options -da and -dl used when decompiled.

Once properly decompiled and Externals taken care of, along with other errors can you work with the AML format to apply patches?
 
..
Once properly decompiled and Externals taken care of, along with other errors can you work with the AML format to apply patches?

No.

Let me state it quite simply (because this comes up a lot): If you are opening an AML file directly in MaciASL and clicking Compile, you are doing it WRONG. Let that soak into the gray matter between your ears for a minute.
 
Hi mr. RehabMan
Please tell me what should happen when you type the command cd / Users / Sergey / Bin / iasl -da -dl * .aml, and I've got nothing happens

?????? ?????? 2016-01-13 ? 0.42.45.png
 
Hi mr. RehabMan
Please tell me what should happen when you type the command cd / Users / Sergey / Bin / iasl -da -dl * .aml, and I've got nothing happens

View attachment 171778

That is not a valid command. You have two command lines concatenated as a single command line.

I don't know why you think that should work.

You may wish to find a tutorial on Terminal/bash so you know the basics.
 
That is not a valid command. You have two command lines concatenated as a single command line.

I don't know why you think that should work.

You may wish to find a tutorial on Terminal/bash so you know the basics.

Thank you. Only the description of the team need to add a point and /

./iasl -da -dl *.aml
 
Thank you. Only the description of the team need to add a point and /

./iasl -da -dl *.aml

The guide recommends copying iasl to /usr/bin where it will be in the PATH. No need to specify ./ then.
 
The guide recommends copying iasl to /usr/bin where it will be in the PATH. No need to specify ./ then.

I only work with ./
Please tell me how to remove this error (Код 6126
Syntax error, unexpected PARSEOP_NAMESEG, expecting $end and premature End-Of-File). I tried to delete a row but the error remains. And yet the question of why the file DSTD.otl patch works and DSTD.dsl only half of the patch works. Sorry for my English.
 

Attachments

  • battery_Samsung-Series3-NP350U2.zip
    1.5 KB · Views: 94
  • dstd.zip
    4.1 MB · Views: 173
I only work with ./

If you copy iasl to /usr/bin, then not needed.

Please tell me how to remove this error (Код 6126
Syntax error, unexpected PARSEOP_NAMESEG, expecting $end and premature End-Of-File). I tried to delete a row but the error remains. And yet the question of why the file DSTD.otl patch works and DSTD.dsl only half of the patch works. Sorry for my English.

Your DSDT.dsl is weird -- very strange content. Start over with disassembly.
 
Hi RehabMan,

I`ve managed to fix all the DSDT errors (no patch applied so far, just plain DSDT), but one:
Line Code Message
12641 6126 Syntax error, unexpected PARSEOP_ARGO

googling has suggested to delete the line containing Arg0... I get no errors, but hell of a lot of warnings, remarks and optimizations
Code:
Method (ADBG, 1, Serialized)
    {[INDENT]If (CondRefOf (MDBG))[/INDENT]
[INDENT]{[/INDENT]
[INDENT=2]MNIO (Arg0)[/INDENT]
[INDENT=2]MNIO ("\n")[/INDENT]
[INDENT=2]Return (MDBG)[/INDENT]
[INDENT=2]Arg0[/INDENT]
[INDENT]}

[/INDENT]
[INDENT]Return (Zero)[/INDENT]
    }

I`m posting .dsl file - all according to your guides: extracted from Linux, dissasembled with iasl (from repo of yours). As acpi compile version in MaciASL I`ve set ACPI 5.0A (no plain 5.0 in my options)
 

Attachments

  • DSDT.dsl.zip
    61.3 KB · Views: 99
Back
Top