DSDT/SSDT: Edit with MacIASL

After dumping and decompiling DSDT/SSDTs to .dsl text format, you need to use MacIASL to edit them and compile them into .aml format.

MacIASL’s main features:

  • Automatically dumping and decompiling system’s ACPI tables: File > New from ACPI > choose table
  • Show bugs in tables with Compile button
  • Apply patches
  • Compile into .aml format: File > Save as > File format: ACPI Machine Language Binary

Adding DSDT repos:

There are many DSDT patch repos on the internet, you just need to add its address to MacIASL in order to access them ( require internet connection ). To add a repo, select MacIASL > Preferences > Source > click the “ + “ button, add the name and URL to the repo.

Here are some useful repos:

  • PJALM Desktop patch:
<span class=”pln”>http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/asus</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/gigabyte</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/msi</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/asrock</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/zotac</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/intel6</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/intel7</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/general</span>/</span><span class=”pln”>
http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>pjalm.info/repos/graphics</span>/</span>
  • HP Probook patch:
<span class=”pln”>http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>raw.github.com/RehabMan/HP-ProBook-4x30s-DSDT-Patch/master</span></span>
  • Laptop patch:
<span class=”pln”>http</span><span class=”pun”>:</span><span class=”com”>//<span class=”skimlinks-unlinked”>raw.github.com/RehabMan/Laptop-DSDT-Patch/master</span></span>


Fix errors after decompiling

You may get errors when compiling the decompiled DSDT/SSDT DSL files. This happens because of these:

Use the incorrect ACPI version to compile

Some systems use ACPI 4.0 while some use ACPI 5.0 which leads to errors ( i.e use ACPI 5.0 to compile a 4.0 DSDT ). To determine which ACPI version is compatible with your DSDT, try compiling with both, then use the one that give you less errors.

To switch ACPI 4.0/5.0 with MacIASL, go to Preferences and select the version you want, then compile again.

Missing information when compiling

They’re common problem on systems with multiple SSDTs , especially Haswell systems. A DSDT/SSDT file can use the Object/Methods which are defined in other DSDT/SSDT files, and decompiler can’t recognize right function structure if you only decompile 1 file at a time. You have to decompile dsdt/ssdt with reference to other dsdt/ssdt files. Follow this guide to decompile them

Some common DSDT/SSDT errors

Syntax errors

Some syntax errors like  _PLD, TNOT, FPED, etc… can be patched by using patches in Rehabman’s DSDT repo


Incorrect syntax identification

Some syntax can’t be identified when compiling, because they do not exist in any DSDT/SSDT, which can cause some errors related to function structure:


In the above image, the error is in those lines:

<span class=”typ”>Return</span> <span class=”pun”>(</span><span class=”pln”>MDBG</span><span class=”pun”>)</span>
<span class=”typ”>Arg0</span>

Why does this happen? The correct structure for MDBG is a method with 1 argument, but it’s not defined in any .aml files, so the IASL just GUESS it as a VARIABLE instead of METHOD. We can fix it by changing it to correct structure:

<span class=”typ”>Return</span> <span class=”pun”>(</span><span class=”pln”>MDBG</span><span class=”pun”>(</span><span class=”typ”>Arg0</span><span class=”pun”>))</span>

However, you can just remove both lines and it’s still fine, and even better! Why? As I explained, the cause of the error is that the MDBG method is found in any DSDT/SSDT, and any call to that MDBG in real time will FAIL, which leads to functions containing MDBG will FAIL too!

Incorrect OperationRegion structure

This error is the result of above errors, which lead to wrong decompiled structure of OperationRegion:


We have to reconstruct it:

<span class=”typ”>OperationRegion</span> <span class=”pun”>(</span><span class=”pln”>VAR1</span><span class=”pun”>,</span><span class=”pln”> VAR2</span><span class=”pun”>,</span><span class=”pln”> VAR3</span><span class=”pun”>,</span><span class=”pln”> VAR4</span><span class=”pun”>)</span>
<span class=”typ”>Field</span> <span class=”pun”>(</span><span class=”pln”>VAR1</span><span class=”pun”>,</span><span class=”pln”> VAR2</span><span class=”pun”>,</span><span class=”pln”> VAR3</span><span class=”pun”>,</span><span class=”pln”> VAR4</span><span class=”pun”>)</span>
<span class=”pun”>{</span><span class=”pln”>
       </span><span class=”pun”>….</span>
<span class=”pun”>}</span>

For example, to fix the error in above image:

<span class=”typ”>OperationRegion</span> <span class=”pun”>(</span><span class=”pln”>HRPE</span><span class=”pun”>,</span> <span class=”typ”>SystemMemory</span><span class=”pun”>,</span><span class=”pln”> _GPE</span><span class=”pun”>.</span><span class=”pln”>MMTB</span><span class=”pun”>,</span> <span class=”lit”>0x04</span><span class=”pun”>)</span>
<span class=”typ”>Field</span> <span class=”pun”>(</span><span class=”pln”>HRPE</span><span class=”pun”>,</span> <span class=”typ”>DWordAcc</span><span class=”pun”>,</span> <span class=”typ”>Lock</span><span class=”pun”>,</span> <span class=”typ”>Preserve</span><span class=”pun”>)</span>
<span class=”pun”>{</span><span class=”pln”>
       VDPC</span><span class=”pun”>,</span><span class=”pln”>   </span><span class=”lit”>32</span>
<span class=”pun”>}</span>

Forget about warnings and remarks, they won’t affect much.

We will be happy to hear your thoughts

Leave a reply