[TOC]
***
# 【指南】 為`USBInjectAll.kext`創建一個自定義的SSDT
英文原文:[[Guide] Creating a Custom SSDT for USBInjectAll.kext](https://www.tonymacx86.com/threads/guide-creating-a-custom-ssdt-for-usbinjectall-kext.211311/)
# 概述 (Overview)
One of the serious issues most users will face with 10.11.x (and later, including 10.12.x) is the new USB stack in OS X/macOS. It has a much heavier reliance on ACPI, and as a result is much more likely to expose bugs in your ACPI implementation of _PLD, and _UPC.
It is covered in detail in my guide: https://www.tonymacx86.com/threads/guide-10-11-usb-changes-and-solutions.173616/
You should be familiar with the writeup above before attempting a custom SSDT.
Many tend to over-simplify the problem, and, for example, believe they can simply apply the port-limit patch and install USBInjectAll.kext and be done with it. In fact, the port limit patch is known to cause problems (it causes access outside a fixed array bounds). Somewhat alarming is the fact that Multibeast includes the port limit patch without mention of its problems.
The fact: Using the port limit patch is not a long term solution. For reliable USB (assuming your ACPI implementation of _PLD and _UPC is broken... and you don't want to fix it), you must implement a custom SSDT for USBInjectAll.kext that configures your ports on XHC such that the port limit patch is not needed, and each UsbConnnector value is correct for each port.
Not only does a custom SSDT allow you to avoid the port limit patch, disabling USB ports that are not used, can have some power saving properties, and can avoid bugs with sleep, restart, or shutdown.
This guide will show how this is done.
The process consists of the following steps:
- preparation for port discovery
- port discovery
- creating custom SSDT for USBInjectAll.kext
- testing/verification
The MaciASL used by this guide is available here: https://bitbucket.org/RehabMan/os-x-maciasl-patchmatic/downloads/
Make sure you have ACPI 6.1 selected in MaciASL->Preferences->iASL.
# 為發現端口做準備(Preparation for port discovery)
In order to create a custom SSDT that contains the correct data for a given computer's USB arrangement, we must first discover all the ports that need to be enabled. Once we know which ports are used, we can eliminate the unused ports.
In order to discover the ports, we need to be certain all ports are enabled.
Requirements:
- EHC1->EH01 and EHC2->EH02 rename (in config.plist), if applicable (your chipset may not have EHCI, or it may be disabled)
- XHCI controller must be named XHC (for most PCs it is default)
- port limit patch (in config.plist)
- install USBInjectAll.kext (install to the system volume)
- if you plan to use it, install FakePCIID.kext + FakePCIID_XHCIMux.kext
- if you have an existing SSDT for USBInjectAll, use -uia_ignore_rmcf
- XHCI injector kext, if required (200-series need XHCI-200-series-injector.kext)
The EHCx renames and port limit patches are available in config_patches.plist (https://github.com/RehabMan/OS-X-USB-Inject-All/raw/master/config_patches.plist) in the USBInjectAll.kext repository. Use copy/paste from a plist editor to get them into your own config.plist.
The EHCx renames look like this in Xcode:

- 簡介
- 基本命令
- 高效操作
- 命令操作
- 常用軟件
- 問題設置
- 命令行神器
- 開發配置
- 開發環境配置
- brew
- git
- Karabiner-Elements
- iTerm2
- MacVim
- aria2
- LaunchBar
- zsh
- Tmux
- Charles
- Emacs(感覺不需要了)
- 常用工具
- Alfred
- mac 詞典增強
- Mac 高級操作
- mac 資源
- 黑蘋果
- 個人配置
- 黑蘋果資源
- 驅動集合
- 工具集合
- 黑蘋果指南
- [FAQ] 開始必讀!筆記本電腦常見問題
- [指南] hackintosh之SSDT/DSDT
- [指南] hackintosh之hotpatch
- [指南] 為Sierra(以及后來的版本)進行USB電源屬性注入
- [指南] 10.11+ USB的變化和解決方案
- [指南] 為USBInjectAll.kext創建一個自定義的SSDT
- [指南] Intel IGPU HDMI/DP audio (Sandy/Ivy/Haswell/Broadwell/Skylake)
- [指南] 怎么給DSDT打補丁來顯示電池狀態
- [指南]在雙GPU筆記本電腦中禁用獨立顯卡.md
- [指南]
- OpenCore
- 多系統引導
- hotpatch
- 黑蘋果裝機
- 刷BIOS大法
- dd