Use all USB3 ports of Intel DH87RL on El Capitan

Today I succeeded in enabling all of my Intel DH87RL motherboard's USB3 ports.

As it turns out, El Capitan's XHCI driver has a limit of 15 ports which was taken up by the board's USB2 ports, leaving just one USB3 port usable.

Since only 8 USB2 ports are actually physically accessible from the outside, disabling the unused ports makes more USB3 ports available.

In theory, this should happen automatically because OS X evaluates the board's DSDT which should flag the user-accessible ports. Needless to say, the DH87RL's DSDT is buggy, so this method fails. ioreg is a helpful tool to find out the current configuration.

Helpfully, Apple has implemented a port disabling feature to handle the case of buggy DSDTs. Examples can be seen by examining the existing plug-ins of the XHCI drivers, to be found at /System/Library/Extensions/IOUSBHostFamily.kext/Contents/PlugIns/AppleUSBXHCIPCI.kext/Contents/Info.plist. This file contains port specifications for each different computer model.

In order to create my own port specification for my DH87RL, I used the fact that the XHCI controller uses a label of 'XHC1' on Apple's DSDT's, while the DH87RL's XHCI is labelled 'XHC' by the DSDT. This allowed me to create my own kext by matching on the emulated model name 'iMac14,2' in combination with 'XHC'.

By trial and error I found out that the USB2 ports provided by the DH87RL are numbered 1, 2, 3, 4, 6, 8, 9 and A. I created a file /EFI/CLOVER/OEM/DH87RL/kexts/10.11/InjectUSB.kext/Contents/Info.plist with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>CFBundleDevelopmentRegion</key>
 <string>English</string>
 <key>CFBundleGetInfoString</key>
 <string>1.0.1, Copyright © 2000-2014 Joki Inc. All Rights Reserved.</string>
 <key>CFBundleIdentifier</key>
 <string>org.joki.injector.usb.USBXHCIDH87RL</string>
 <key>CFBundleInfoDictionaryVersion</key>
 <string>6.0</string>
 <key>CFBundleName</key>
 <string>XHC1 injector for DH87RL</string>
 <key>CFBundlePackageType</key>
 <string>KEXT</string>
 <key>CFBundleShortVersionString</key>
 <string>1.0.1</string>
 <key>CFBundleSignature</key>
 <string>????</string>
 <key>CFBundleVersion</key>
 <string>1.0.1</string>
 <key>IOKitPersonalities</key>
 <dict>
  <key>iMac14,2-XHC1</key>
  <dict>
   <key>CFBundleIdentifier</key>
   <string>com.apple.driver.AppleUSBMergeNub</string>
   <key>IOClass</key>
   <string>AppleUSBMergeNub</string>
   <key>IONameMatch</key>
   <string>XHC</string>
   <key>IOProviderClass</key>
   <string>AppleUSBXHCIPCI</string>
   <key>IOProviderMergeProperties</key>
   <dict>
    <key>port-count</key>
    <data>FQAAAA==</data>
    <key>ports</key>
    <dict>
     <key>HS01</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>AQAAAA==</data>
     </dict>
     <key>HS02</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>AgAAAA==</data>
     </dict>
     <key>HS03</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>AwAAAA==</data>
     </dict>
     <key>HS04</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>BAAAAA==</data>
     </dict>
     <key>HS06</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>BgAAAA==</data>
     </dict>
     <key>HS08</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>CAAAAA==</data>
     </dict>
     <key>HS09</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>CQAAAA==</data>
     </dict>
     <key>HS0A</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>CgAAAA==</data>
     </dict>
     <key>SSP1</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>EAAAAA==</data>
     </dict>
     <key>SSP2</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>EQAAAA==</data>
     </dict>
     <key>SSP3</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>EgAAAA==</data>
     </dict>
     <key>SSP4</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>EwAAAA==</data>
     </dict>
     <key>SSP5</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>FAAAAA==</data>
     </dict>
     <key>SSP6</key>
     <dict>
      <key>UsbConnector</key>
      <integer>3</integer>
      <key>port</key>
      <data>FQAAAA==</data>
     </dict>
    </dict>
   </dict>
   <key>model</key>
   <string>iMac14,2</string>
  </dict>
 </dict>
 <key>OSBundleRequired</key>
 <string>Root</string>
</dict>
</plist>

After reboot, I could use all of my USB3 ports (for reference, numbered 9, A, B, C, D and E).

A handy command to see the kernel boot messages is

$ log show --debug --last boot --style compact

Yosemite with audio on DH87RL with Realtek ALC892

The following is now obsolete thanks to AppleALC which only requires the kernel parameter :Boot:Arguments alcid=1.


In order to get audio functionality in Yosemite on my DH87RL motherboard, I follow toleda's method using Clover. The exact method is encoded as a shell script with the required files in a couple of repositories.

The first task is to find out the current layout-id using the command

$ ioreg -nHDEF -r -w0
There should be a section called "HDEF@1B" with a key "layout-id" showing a value.

In my case, the value was 0 which is not a good sign. Thankfully, Clover can patch it by adding the string value :Devices:Audio:Inject with the desired value "1".

After rebooting, the command

$ ioreg -rxnIOHDACodecDevice
identifies my audio chip as vendor and device 0x10ec0892 (Realtek ALC892) and revision 0x100302 (current).

Now I downloaded and unpacked config-audio_cloverALC.plist.zip and copied the two relevant entries from :KernelAndKextPatches:KextsToPatch to my config.plist: Item 0 with comment »10.9-10.10-AppleHDA/Resources/xml>zml« (the purpose of which will become clear in a little while) and Item 4, »10.9-10.10-AppleHDA/Realtek ALC892«.

Then I downloaded and unpacked realtekALC.kext and installed it into my EFI/CLOVER/OEM/DH87RL/kexts/10.10 folder. Finally, I renamed the files Platforms.xml.zlib and layout[123].xml.zlib from 892.zip to *.zml.zlib, installed them in my /System/Library/Extensions/AppleHDA.kext/Contents/Resources folder and made them owned by root:wheel.

Next, I ensured that the :SystemParameters:InjectKexts was enabled in my config.plist ("Detect") and that :Boot:Arguments contained "kext-dev-mode=1" and rebooted with rebuilding kext cache.

Running Yosemite on UEFI hardware

I use the Clover boot loader in a UEFI-only installation on the ESP with the »BootCamp« theme. The only UEFI driver I need is OsxAptioFix2Drv-64 -- without it I get ???.

The best source for up-to-date kexts I've found is to download the current MultiBeast installer. The »Contents/Resources« folder of »MultiBeast.app« contains packages which can be expanded using

$ pkgutil --expand FakeSMC-v6.14.1364.pkg p
$ pax -rzf p/Payload

For my Intel DH87RL, I drop FakeSMC.kext and AppleIntelE1000e.kext into the corresponding folder OEM/DH87RL/kexts/10.10 on the ESP.

After installing new kexts, a reboot »without caches« must be performed by selecting the boot entry with space bar in Clover and selecting the corresponding entry.

My configuration file OEM/DH87RL/config.plist contains

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>ACPI</key>
 <dict>
  <key>SSDT</key>
  <dict>
   <key>EnableC6</key>
   <true/>
   <key>Generate</key>
   <dict>
    <key>CStates</key>
    <true/>
    <key>PStates</key>
    <true/>
   </dict>
  </dict>
 </dict>
 <key>Boot</key>
 <dict>
  <key>DefaultVolume</key>
  <string>LastBootedVolume</string>
  <key>Timeout</key>
  <integer>5</integer>
  <key>Log</key>
  <false/>
 </dict>
 <key>GUI</key>
 <dict>
  <key>Scan</key>
  <true/>
  <key>Custom</key>
  <dict>
   <key>Legacy</key>
   <array>
    <dict>
     <key>Type</key>
     <string>Windows</string>
     <key>Hidden</key>
     <true/>
    </dict>
   </array>
  </dict>
 </dict>
 <key>KernelAndKextPatches</key>
 <dict>
  <key>Debug</key>
  <false/>
  <key>KernelPm</key>
  <true/>
 </dict>
 <key>RtVariables</key>
 <dict>
  <key>MountEFI</key>
  <false/>
 </dict>
 <key>SystemParameters</key>
 <dict>
  <key>InjectKexts</key>
  <string>Detect</string>
 </dict>
</dict>
</plist>

Installing Mavericks on UEFI hardware

I decided to try and build a Mavericks installer for my new Intel DH87RL based computer. My aim was to use as few extra files as possible from a plain Mavericks installation medium, and especially no tools to perform unknown tasks for me.

I create a Mavericks install medium using the suggestively named script createinstallmedia:

$ cd <Path to Install OS X Mavericks.app>
$ sudo ./Contents/Resources/createinstallmedia --volume /Volumes/<scratch media> --applicationpath "$PWD"

Try to boot...

Next, there is an initially confusing number of boot loader options: Chameleon/Chimera and Clover. According to my research, the former are legacy boot loaders for pre-UEFI boards and will utilise the compatibility module when booted on UEFI hardware -- yuck!

So Clover seems to be the way to go for modern hardware. It even offers a friendly manual installation using only terminal commands without resorting to magic tools.

I am following this handy guide.

Attempts on Asus P6T SE LGA 1366 board with Radeon HD4790

A plain Mavericks installer with a Clover boot loader and an SMBIOS for a MacPro5,1 (LGA1366) boots to a grey screen with an apple logo and a SBBOD (Spinning Beach Ball Of Death).

Adding FaceSMC.kext to /EFI/CLOVER/OEM/P6T SE/kexts/10.9 and setting "InjectKexts" to "Detect" in the "SystemParameters" section of my config.plist successfully brings up the installer. Adding "RealtekRTL81xx.kext" additionally enables ethernet.

The system boots both with my Sapphire HD4350 and an Asus HD7790, but the former chooses the wrong video mode and seems very slow while the second one seems to be better supported by Mavericks. In the installer, Safari flickers a lot with both video cards.

Next, I formatted the EFI partition that the OS X installer had created using FAT32 to enable Clover to write log files or DSDTs (FAT32 is the only writable file system for Clover).

$ sudo newfs_msdos -F 32 -v EFI /dev/disk0s1

Note: FAT32 (-F 32) is important because newfs_msdos picks FAT16 by default which isn't supported by Clover's 'boot1f' code, resulting in the messages:

boot1f: init
boot1f:error

Then I installed Clover to this EFI partition on the target disk with the following settings:

  • Install Clover in the ESP (because I don't want it on my HFS hard drive)
  • Bootloader: Install boot0af in MBR (because I want the 'active' partition flag to work)
  • CloverEFI: CloverEFI 64-bits SATA (I think it does not make a difference on my BIOS-based computer)
  • Install RC scripts on target volume (this was needed to make the NVRAM work, which again is required to set the startup volume and use automatic boot)

This is the config.plist file I use (yes, that's all):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>ACPI</key>
 <dict>
  <key>SSDT</key>
  <dict>
   <key>EnableC6</key>
   <true/>
   <key>Generate</key>
   <dict>
    <key>CStates</key>
    <true/>
    <key>PStates</key>
    <true/>
   </dict>
  </dict>
 </dict>
 <key>Boot</key>
 <dict>
  <key>Timeout</key>
  <integer>0</integer>
 </dict>
 <key>GUI</key>
 <dict>
  <key>Scan</key>
  <true/>
 </dict>
 <key>SystemParameters</key>
 <dict>
  <key>InjectKexts</key>
  <string>Detect</string>
 </dict>
</dict>
</plist>

The resulting system is really cute, but not really usable because the graphics support is too bad. For example, the adjustments in the Colour Calibration preference pane have no effect. iMovie doesn't even start because the requirements aren't satisfied, and iPhoto doesn't show photos in single-photo or edit mode.

Intel DH87RL with i5-4670

On this board, using Intel's »Visual BIOS«, the VT for Directed I/O (VT-d) switch must be turned off in the Security settings for Yosemite to boot successfully.

I copied my existing configuration into the /EFI/CLOVER/OEM/DH87RL/ folder and removed the RealtekRTL81xx.kext from kexts/10.9.

The drive booted fine in BIOS mode, but in UEFI mode I got an "Error exiting boot services" from Clover. From a successful BIOS boot, I added OsxAptioFixDrv and that fixed the problem.

For the network card, this board requires the AppleIntelE1000e driver in the kexts/10.9 folder.

Results with this board and the i5-4670's integrated Intel HD4600 graphics are looking much better than with the HD7790 above: colour calibration and iPhoto just work, for example.

There is still one mysterious problem: "Shut Down" in the system menu has the same effect as "Restart"...

In order to dual-boot Windows with OS X, I used Clover's "Add Clover as EFI boot option", which created a "Firmware Application" entry for Clover visible in bcdedit /enum all. I made this the default boot entry using the command

bcdedit /set {fwbootmgr} displayorder {...} /addfirst
where the last item is the identifier value of Clover's entry. This motherboard doesn't actually show a boot menu with different options as suggested by the name displayorder, but simply boots the first entry in the list. The timeout value in the {fwbootmgr} section refers to the time that the Intel logo is shown.

Abandoned initial attempts for reference

Using a guide, I extracted BaseSystem.dmg onto a USB key and inserted the Packeges folder. I then used pkgutil to extract mach_kernel and dropped it in the root folder.

$ cd
$ xar -xf "/Volumes/OS X Install ESD/Packages/BaseSystemBinaries.pkg" Payload
$ pax -rjf Payload ./mach_kernel
$ mv mach_kernel "/Volumes/OS X Base System"
$ rm Payload

At this point, the new install medium should boot fine.

In order to enable booting on generic UEFI hardware, I downloaded FaceSMC.kext from tonymacx86 and copied it to /System/Library/Extensions on the installation medium.