Patching DSDT

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:

  • HP Probook patch:

  • Laptop patch:

4SLBaVu.png

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

ZwO0ebM.png

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:

FAxgxur.png

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

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:

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:

f0uowOG.png

We have to reconstruct it:

For example, to fix the error in above image:

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

We will be happy to hear your thoughts

Leave a reply