[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:
![EHCx-renames](https://box.kancloud.cn/1dcce1a30d08c2f84e0475915c7ff5b3_499x303.png)
- 简介
- 基本命令
- 高效操作
- 命令操作
- 常用软件
- 问题设置
- 命令行神器
- 开发配置
- 开发环境配置
- 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