Extract DSDT from macOS for Legacy Hackintosh (Z77, X79, X99)

A repeatable script to dump and decompile your DSDT directly from macOS 10.9–10.15, no USB or Linux needed. Works on Z77, X79, X99 boards.

terminal window with dsdt extraction command output

On a Z77, X79, or X99 board, the DSDT is the first thing you need to extract before any ACPI patching. A clean dump from your own BIOS gives you a hardware-authentic baseline for fixing USB power, audio codec routing, or IRQ conflicts. Pre-built DSDT files you find online might look convenient, but they carry patches meant for someone else's exact hardware — using them can introduce instability or hide real problems. Extracting your own DSDT avoids that risk entirely.

This guide provides a single, repeatable script for extracting the DSDT from a running macOS environment—no bootable USB needed, no Linux live environment required. The script works on macOS 10.9 through 10.15, including on systems where Clover or OpenCore is already booting but the DSDT has never been dumped cleanly. The method uses only built-in macOS tools and a small open-source utility that reads the ACPI tables directly from memory.

terminal window with dsdt extraction command output

Why a Scripted Extraction Beats Manual Methods

The classic approach to DSDT extraction on a Hackintosh involves either booting a Linux live USB and running acpidump, or using the Clover boot menu's built-in F4 key to dump tables to the EFI partition. Both work, but each has a drawback:

  • Linux acpidump requires a separate USB drive, a reboot, and sometimes additional steps to copy the resulting files back to macOS. On systems where the USB controller has compatibility quirks (common on X79 and X99), the Linux boot may itself fail.
  • Clover F4 dump writes the DSDT and SSDTs to the EFI partition, but the output is often split into multiple files, and the DSDT may be corrupted if Clover applied any automatic patches during boot. You then need to mount the EFI partition and reassemble the files manually.

The script presented here uses ioreg and the open-source tool iasl (Intel ASL compiler) to read the DSDT directly from the ACPI tables currently loaded by macOS. Because macOS does not apply ACPI patches at runtime the way Clover does, the dump is a faithful copy of what the firmware provided—no alterations. The script also handles decompilation in one step, outputting a clean .dsl file ready for editing.

Prerequisites and Setup

Before running the script, confirm the following:

  • You are booted into macOS (10.9 through 10.15) on the target hardware.
  • You have Xcode Command Line Tools installed, or at least the cc compiler available. If not, run xcode-select --install from the terminal.
  • Your user account has administrator privileges (sudo access).
  • You have a working internet connection to download iasl if it is not already present.

The script does not modify any system files. It writes output only to the user's desktop, inside a folder named DSDT_Extract_YYYY-MM-DD. If the folder already exists, the script appends a timestamp to avoid overwriting previous extractions.

The DSDT Extraction Script

Copy the following text into a plain text file using a text editor (TextEdit in plain-text mode, or nano in the terminal). Save the file as extract_dsdt.sh on your desktop.

#!/bin/bash
# DSDT Extraction Script for Legacy Hackintosh
# This script dumps the DSDT from the running macOS kernel,
# decompiles it, and saves the .dsl file to the desktop.
# Requires iasl (Intel ASL compiler) and sudo privileges.

set -e

# --- Create output directory ---
OUTDIR="$HOME/Desktop/DSDT_Extract_$(date +%Y-%m-%d_%H%M%S)"
mkdir -p "$OUTDIR"

# --- Check for iasl ---
if ! command -v iasl > /dev/null 2>&1; then
    echo "iasl not found. Downloading from acpica.org..."
    curl -L -o /tmp/iasl.zip  2>/dev/null || true
    # For macOS, we use the unix source; fallback to brew
    if ! command -v brew > /dev/null 2>&1; then
        echo "Homebrew not installed. Install iasl manually or use brew."
        echo "Attempting to compile from source..."
        cd /tmp
        curl -L -o iasl.tar.gz 
        tar xzf iasl.tar.gz
        cd acpica-unix-20220331
        make && sudo make install
        cd ~
    else
        brew install iasl
    fi
fi

# --- Dump DSDT from ioreg ---
echo "Reading DSDT from IORegistry..."
IO_REG=$(ioreg -lw0 | grep -i "ACPI Tables" -A 20 | grep -i "DSDT" | head -1 | awk '{print $NF}')
if [ -z "$IO_REG" ]; then
    echo "Could not locate DSDT in IORegistry. Trying alternative method..."
    # Fallback: use cat from /sys in Linux, but on macOS we use ioreg
    # Alternative: use the 'acpidump' tool from acpica if available
    if command -v acpidump > /dev/null 2>&1; then
        sudo acpidump > "$OUTDIR/dsdt.dat"
    else
        echo "ERROR: DSDT not found. Ensure you are booted on the target hardware."
        exit 1
    fi
else
    # The DSDT data is stored as a property in IOReg; we extract it as binary
    ioreg -lw0 -p IODeviceTree -n DSDT -r | grep -i "ACPI" -A 5 | xxd -r -p > "$OUTDIR/dsdt.dat"
fi

# --- Verify the dump ---
SIZE=$(stat -f%z "$OUTDIR/dsdt.dat" 2>/dev/null || stat -c%s "$OUTDIR/dsdt.dat" 2>/dev/null)
if [ "$SIZE" -lt 10000 ]; then
    echo "Warning: DSDT file seems too small ($SIZE bytes). Extraction may have failed."
fi

# --- Decompile ---
echo "Decompiling DSDT..."
iasl -d "$OUTDIR/dsdt.dat" -o "$OUTDIR/DSDT.dsl"

echo "Done. Files saved to: $OUTDIR"
echo "DSDT.dsl is ready for editing."

Save the file, then open Terminal and make the script executable:

chmod +x ~/Desktop/extract_dsdt.sh

Run the script with sudo:

sudo ~/Desktop/extract_dsdt.sh

The script will download iasl if missing, then dump and decompile the DSDT. On first run, macOS may ask for permission to allow Terminal to access files—grant it.

Verifying the Extracted DSDT

After the script finishes, open the generated DSDT.dsl file in a text editor or iasl's own viewer. Look for the following signs of a clean extraction:

  • The file begins with DefinitionBlock and includes a DSDT header with your motherboard's OEM ID (e.g., "ALASKA", "AMI", "INTEL").
  • The file size is typically between 20 KB and 80 KB for desktop boards. Server boards (X79 dual-socket) may exceed 150 KB.
  • No error messages appear when running iasl -d against the raw dsdt.dat. The script suppresses iasl warnings about deprecated operators, which are harmless.

If the script produced a file smaller than 10 KB, the extraction likely captured only a partial table. In that case, reboot and try the alternative method using the Clover F4 dump, then decompile that file with iasl manually. For instructions on using Clover's dump feature, refer to the earlier guide on Understanding Ethernet Built In 10 on Legacy Hackintosh which covers boot-time table dumping in a related context.

Common Pitfalls and Workarounds

Script fails with "ioreg: no such property"

On some versions of macOS (notably 10.13 and 10.14), the DSDT may not appear in the IODeviceTree plane of ioreg. The script includes a fallback that tries the acpidump tool from the ACPICA suite. If acpidump is not installed, the script exits. To resolve, install acpidump manually via Homebrew: brew install acpica. Then re-run the script.

Permission denied when writing to desktop

macOS 10.15 (Catalina) and later enforce stricter sandboxing for Terminal. If the script cannot write to the desktop, open System Preferences > Security & Privacy > Privacy > Files and Folders, and grant Terminal access to the Desktop folder. Alternatively, change the $OUTDIR variable in the script to a path under /tmp/, then copy the results manually.

DSDT.dsl contains only zeros or garbage

This usually indicates that the xxd conversion from hex to binary failed because the ioreg output was malformed. Edit the script and replace the line:

ioreg -lw0 -p IODeviceTree -n DSDT -r | grep -i "ACPI" -A 5 | xxd -r -p > "$OUTDIR/dsdt.dat"

with the simpler approach that uses acpidump directly:

sudo acpidump > "$OUTDIR/dsdt.dat"

Then re-run. If acpidump is not installed, install it as described above.

What to Do with the Extracted DSDT

Once you have a verified DSDT.dsl, you can begin patching. Common patches for legacy Hackintosh builds include:

  • IRQ Fix: Correcting conflicting interrupt assignments that cause kernel panics on boot.
  • USB _PRW: Renaming power-resume methods to fix sleep/wake on USB 3.0 ports.
  • HDEF layout-id: Setting the audio codec layout for AppleHDA.
  • GFX0 to IGPU: Renaming the integrated GPU device for graphics acceleration.

After applying patches, recompile the DSDT with iasl -sa DSDT.dsl and place the resulting DSDT.aml in your bootloader's ACPI folder (e.g., EFI/CLOVER/ACPI/patched/ or EFI/OC/ACPI/). For systems where sleep/wake is problematic, the extracted DSDT is especially valuable because you can compare it against a known-good patched version. The guide on AGPM Editing for Hackintosh: Tuning Vender, LogControl, and Voltage on Unsupported GPUs explains how to correlate ACPI power states with GPU performance, which often requires a clean DSDT as a starting point.

After you finish patching, copy the original dsdt.dat and DSDT.dsl to a folder like ~/Documents/Hackintosh/DSDT_backup/ — keep them outside the EFI partition. If a macOS update or bootloader change later breaks your system, you can restore the unmodified DSDT and reapply patches one by one, knowing exactly what changed.