How to patch your DSDT

RehabMan edited this page Mar 28, 2015 · 24 revisions
Clone this wiki locally

Although there are pre-patched DSDTs available as downloads from the tonymacx86.com forums and in installer packages such as the HP ProBook Installer, there can be differences in individual DSDTs that can cause delays in booting and perhaps other problems. Perhaps there are slight differences in BIOS settings, memory installed, etc, that is causing these differences. It is best, therefore, to patch your own DSDT and install it into /Extra/dsdt.aml (Chameleon) or EFI/Clover/ACPI/patched (Clover).

Note: The current version of the ProBook Installer actually uses this patch repo to patch your own DSDT.

Extracting your native DSDT

I have included five different methods for extracting your native DSDT. Just pick the method that seems easiest for you. The easiest one will depend on whether you still have Windows installed, whether you already have a Linux USB stick prepared, and just how familiar you are with both systems.

Extracting your native/clean DSDT using MaciASL or DSDT Editor under OS X

Boot your OS X installation with DSDT=No or without a DSDT installed to /Extra/dsdt.aml. To boot with DSDT=No, just type it at the Chimera/Chameleon boot screen and press enter. This will boot your system with the OEM provided DSDT such that MaciASL or DSDT Editor can be used to extract the raw DSDT.

If you have a high-resolution screen (1600x900 or 1920x1080) you will not be able to boot without a DSDT. If this is your case, copy Mini-SSDT-DualLink.aml to the Unibeast USB /Extra/ssdt.aml. This SSDT inserts a small patch into ACPI namespace that allows you to get a valid screen on the laptop display, but will not impact the raw DSDT extracted by MaciASL or DSDT Editor.

Extracting your native/clean DSDT using Linux 'acpidump'

In order to use the patches provided in this repository, you first have to acquire your native/clean DSDT. One way to do that is with acpidump in Linux.

First of all, you need the ability to run Linux. For that I recommend creating a USB stick with Ubuntu. Read and follow these complete instructions: http://www.ubuntu.com/download/help/create-a-usb-stick-on-windows. After you get your Ubuntu USB stick made, boot from it. On the HP ProBook, you tap the F9 key during BIOS startup and you will get the opportunity to boot from devices other than the hard disk. Select your USB stick with Ubuntu on it. When the Ubuntu menu appears, choose the first one, where you are just running (not installing) Ubuntu. If you decide to use Ubuntu on a regular basis, you can install it. For that I suggest you see my guide at http://racerrehabman.wordpress.com/2012/07/06/guide-to-installing-windows-7-windows-8-mac-os-x-lion-and-ubuntu-multi-boot/ which has complete instructions for multi-booting Win7, Win8, Lion, and Ubuntu.

Now you should be running Ubuntu. To get 'acpidump' you first need to enable the 'universe' software repository. To do so, it is easiest to follow this guide: https://help.ubuntu.com/community/Repositories/Ubuntu#Adding_Repositories_in_Ubuntu

After adding 'universe' to the Ubuntu Software Center's software sources, you are ready to install acpidump and run it. You will need internet access to get the acpidump software, so if you are using a wireless connection, now is a good time to connect to it. After that, open Terminal (Ctrl+Alt+T), and type the following commands:

sudo apt-get update
sudo apt-get install acpidump

Now you have acpidump installed so, we can run it:

sudo acpidump -b -t DSDT -o dsdt.aml

Now copy the dsdt.aml file somewhere that you can access from your installation of Mac OS (a USB key perhaps). The dsdt.aml file you have now is a raw DSDT from your BIOS that you can use to apply the patches in this repository to create your patched DSDT.

Extracting your native/clean DSDT using Linux /sys/firmware/acpi/tables/DSDT

I didn't know this, but evidently the ACPI tables are directly available and mounted in the file system. This is much simpler than using acpidump, especially if running from the Ubuntu Live USB.

All you have to do is run the following command in Terminal:

sudo cat /sys/firmware/acpi/tables/DSDT >dsdt.aml

Then copy resulting dsdt.aml somewhere convenient to bring with you to your OS X install for patching.

Extracting your native/clean DSDT using Clover F4

If you press F4 at the main Clover bootloader screen, Clover will write your native files to EFI/Clover/ACPI/origin. There is no feedback when you press F4, so don't expect anything to "happen" when you press the key. Also, keep in mind that some BIOS implementations (newer computers) tend to reverse the Fn+F1..F12 and F1..F12 keys, so be sure you're pressing the correct key combination to generate F4.

Extracting your native/clean DSDT using Windows

I haven't used this method personally, but have used this application for other things and it seems that it also has the capability to extract ACPI tables. The program is "Read-Write Everything" and it is available at the following website: http://rweverything.phpnet.us/index.htm

Once you have installed RW-Everything, run it and from the "Access" menu, choose "ACPI Tables". From the "ACPI Table" window that opens, first select the DSDT tab to make sure the DSDT table is active, then choose the "Save as Binary" button on toolbar (or Shift+F2). Save that file to a place easy to transfer to your MAC OS installation.

Creating your patched DSDT using MaciASL

MaciASL is a very nice native OS X program. It is much faster than using DSDT Editor and more polished. MaciASL is the recommended way to patch your DSDT. MaciASL is available only on Lion or newer.

Note: You can also use my fork of MaciASL: https://github.com/RehabMan/OS-X-MaciASL-patchmatic

  • Now Run MaciASL.
  • First time through, check preferences, iASL tab: Compiler options set to ACPI 5.0
  • While in preferences, add the repo under Sources tab: Click the [+] button to add a patch repo.
  • Type whatever name you like in the first column... "ProBook" is fitting.
  • Type (or copy/paste) the URL for the patch repo:
http://raw.github.com/RehabMan/HP-ProBook-4x30s-DSDT-Patch/master
  • Now you can close Preferences
  • Use File Open to open your unpatched/raw DSDT you extracted earlier
  • Choose Patch from the toolbar
  • On the left you should see "ProBook" patch repo added in Preferences earlier
  • The patches are divided into groups. Select one from the first group "ProBook 4x30s" "ProBook 4x40s Ivy Bridge" or "ProBook 4x40s Sandy Bridge" depending on your specific laptop.
  • The patch text will load in the upper part of the patch window, and after a few seconds the preview window in the lower section will fill in with before/after data
  • For my machine (4540s w/ F.60 BIOS) it shows 128 Patches, 173 changes, 0 Rejects
  • Click on the Apply button to apply the patches. The patch window will clear.
  • Now select from the next group, either "IGPU/LVDS Single-Link" if you have the standard 1366x768 laptop display, or "IGPU/LVDS Dual-Link" if you have the high resolution 1600x900 or 1920x1080 upgraded screen.
  • Again the patch text will load in the upper part of the patch window. Click on the Apply button to apply the patches. The patch window will clear.
  • Now select from the next group, your desired fan behavior. The patch window will fill, then hit Apply to apply the patch.
  • None of the Optional patches are not necessary
  • Now select "ACPI backlight control". Click Apply.
  • Select one of the keyboard maps depending on your hardware "ProBook 102-key layout" or "Probook 87-key layout"
  • You can now Close the patch window by clicking on the Close button.
  • Choose Save As... and pick a location to save your patched DSDT. Be sure to save it as File Format "ACPI Machine Language Binary" Save it to the desktop if you're not sure where to save it.
  • Now copy the resulting DSDT.aml to your /Extra/dsdt.aml or EFI/Clover/ACPI/patched (depending on bootloader). You can use Terminal:
# assuming Chameleon
sudo cp ~/Desktop/DSDT.AML /Extra/DSDT.AML
# assuming Clover, EFI partition mounted at /Volumes/EFI
cp ~/Desktop/DSDT.AML /Volumes/EFI/Clover/ACPI/patched/DSDT.AML

Note regarding native power management

This version of the patching instructions assumes you'll be implementing native power management where the OEM SSDTs are not dropped. This is a change to how native power management had been implemented in the past.

If you're not using this new technique for native power management, you should also apply "For non-OEM CPU SSDTs (deprecated patches)" to your DSDT.

If you are using the new technique (recommended), you should check your settings:

  • set config.plist/ACPI/SSDT/DropOem=false (DropSSDT=No if using Chameleon)
  • set config.plist/ACPI/SSDT/Generate=false
  • optionally, drop SSDT 'PtidDevc' (with DropTables)

Note: Even with the new technique, you still need SSDT.AML generated from ssdtPRgen.sh (the script that the Probook Installer uses)