> ## Content Index
> Fetch the complete content index at: https://iiong.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# 总结归纳 Hackintosh 的一些问题
- URL: https://iiong.com/summarize-some-problems-of-hackintosh/
- Published: 2024-05-10T15:08:15.000Z
- Updated: 2026-06-22T15:24:06.000Z
- Description: 从2019年低开始正式入 Hackintosh 的坑，一直用到现在，从 ARM 的桌面设备出现，就意味着 Hackintosh 进入死亡倒计时。不过最近买了新的主机，这可能对我来说是最后一台 Hackintosh 主机了。
- Author: 淮城一只猫
- Tags: 生活琐事

### Cap1 前言

从2019年低开始正式入 [Hackintosh](https://iiong.com/document-my-installation-hackintosh-process) 的坑，一直用到现在，从 `Apple ARM` 的桌面设备出现，就意味着 `Hackintosh` 进入死亡倒计时。不过最近买了新的主机，这可能对我来说是最后一台 `Hackintosh` 主机了。由于之前的 `8700k` 设备不能满足于开发和娱乐环境，就寻思要换主机设备。

### Cap2 新主机

先说说硬件配置吧，要满足接近完美 `Hackintosh` 需要在硬件上做足准备，所以有些硬件在现在看起来不是主流，优先适配 `Hackintosh` 系统即可：

| 硬件类型 | 硬件说明                            | 备注说明            |
| ---- | ------------------------------- | --------------- |
| 处理器  | Intel Core i7-14700KF           |                 |
| 主板   | 技嘉 B760M AORUS ELITE            |                 |
| 内存   | 金士顿 DDR5 64 GB 5600MHz 32GB x 2 |                 |
| 系统硬盘 | 致态 SSD 1TB / 致态 SSD 500GB       | macOS / win 双系统 |
| 数据硬盘 | 金士顿 SSD 1TB / 希捷2T HHD          |                 |
| 显卡   | AMD Radeon RX 6900 XT           | 其他品牌刷蓝宝石 Bios   |
| 网卡   | BCM4356 2230                    | macOS 免驱        |

### Cap3 Hackintosh 配置

本来想在 `Github` 随便找个 `EFI` 用好了，不过玩 `Hackintosh` 这么久还是自己动手建立专属 `EFI` 使用，根据现有的资料，弄了能基本使用的 `EFI`。

根据 [Dortania 文档](https://dortania.github.io/Getting-Started-With-ACPI/ssdt-platform.html?ref=iiong.com#desktop) 查阅了解，根据我的设备信息 `ACPI` 需要如下文件：

| ACPI 名            | 说明       | 备注 |
| ----------------- | -------- | -- |
| SSDT-AWAC.aml     | 修复电源管理   |    |
| SSDT-EC-USBX.aml  | 修复嵌入式控制器 |    |
| SSDT-PLUG-ALT.aml | 修复系统时钟   |    |

据说技嘉主板需要很多类似的文件，不过上面我只弄了三个文件就可以用了。然后一些 `Quirk` 特性在网上找资料看看就可以了，推荐 `国光黑苹果` 教程，写的确实不错。关于 `Kext` 我列出目前已有的：

| Kext 名                                                                                 | 说明                                                                                               | 备注                      |
| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | ----------------------- |
| [Lilu.kext](https://github.com/acidanthera/Lilu?ref=iiong.com)                         | 扩展库                                                                                              | 必备核心                    |
| [VirtualSMC.kext](https://github.com/acidanthera/VirtualSMC?ref=iiong.com)             |                                                                                                  |                         |
| [USBMap.kext](https://github.com/USBToolBox/tool?ref=iiong.com)                        | USB 映射定制                                                                                         | 需定制，后面会提                |
| [SMCRadeonSensors.kext](https://github.com/ChefKissInc/SMCRadeonSensors?ref=iiong.com) | AMD 传感器驱动                                                                                        |                         |
| [BlueToolFixup.kext](https://github.com/acidanthera/BrcmPatchRAM?ref=iiong.com)        |                                                                                                  |                         |
| [AirportBrcmFixup.kext](https://github.com/acidanthera/BrcmPatchRAM?ref=iiong.com)     |                                                                                                  |                         |
| [BrcmFirmwareData.kext](https://github.com/acidanthera/BrcmPatchRAM?ref=iiong.com)     |                                                                                                  |                         |
| [BrcmPatchRAM3.kext](https://github.com/acidanthera/BrcmPatchRAM?ref=iiong.com)        |                                                                                                  |                         |
| [SMCProcessor.kext](https://github.com/acidanthera/VirtualSMC?ref=iiong.com)           |                                                                                                  |                         |
| [SMCSuperIO.kext](https://github.com/acidanthera/VirtualSMC?ref=iiong.com)             |                                                                                                  |                         |
| [WhateverGreen.kext](https://github.com/acidanthera/WhateverGreen?ref=iiong.com)       |                                                                                                  |                         |
| [LucyRTL8125Ethernet.kext](https://github.com/Mieze/LucyRTL8125Ethernet?ref=iiong.com) | 网卡驱动                                                                                             |                         |
| [CPUFriend.kext](https://github.com/acidanthera/CPUFriend?ref=iiong.com)               |                                                                                                  |                         |
| [CPUFriendDataProvider.kext](https://github.com/acidanthera/CPUFriend?ref=iiong.com)   |                                                                                                  | 这里使用 iMacPro1,1 的数据     |
| [CpuTopologyRebuild.kext](https://github.com/b00t0x/CpuTopologyRebuild?ref=iiong.com)  |                                                                                                  | boot arg 添加 \-ctrsmt 参数 |
| AppleSSD.kext                                                                          | [参考](https://github.com/Hyejeongdd/NUC8i5BEK-Hackintosh/tree/Monterey/EXTRA/Kexts?ref=iiong.com) | 可选                      |
| [NVMeFix.kext](https://github.com/acidanthera/NVMeFix?ref=iiong.com)                   |                                                                                                  |                         |
| [RestrictEvents.kext](https://github.com/acidanthera/RestrictEvents?ref=iiong.com)     |                                                                                                  | 显示正确 CPU 信息             |
| [AppleALC.kext](https://github.com/acidanthera/AppleALC?ref=iiong.com)                 |                                                                                                  |                         |

方便给`OCAT` 记录升级清单：

```
Lilu.kext | https://github.com/acidanthera/Lilu
AppleALC.kext | https://github.com/acidanthera/AppleALC
WhateverGreen.kext | https://github.com/acidanthera/WhateverGreen
VirtualSMC.kext | https://github.com/acidanthera/VirtualSMC
RestrictEvents.kext | https://github.com/acidanthera/RestrictEvents
BrcmPatchRAM.kext | https://github.com/acidanthera/BrcmPatchRAM
AirportBrcmFixup.kext | https://github.com/acidanthera/AirportBrcmFixup
NVMeFix.kext | https://github.com/acidanthera/NVMeFix
CPUFriend.kext | https://github.com/acidanthera/CPUFriend
LucyRTL8125Ethernet.kext | https://github.com/Mieze/LucyRTL8125Ethernet
SMCRadeonSensors.kext | https://github.com/ChefKissInc/SMCRadeonSensors
CpuTopologyRebuild.kext | https://github.com/b00t0x/CpuTopologyRebuild

```

上面配置这些驱动目前使用没有问题，后续可能继续再优化精简驱动。

> 使用 `RestrictEvents.kext` 需要开启 `ProvideCurrentCPUInfo` 选项 在 `Kernel` \- `Quirk` 列表中

BIOS 设置如下：

- Load Optimized Defaults
- Settings -> IO Ports -> USB Configuration -> Legacy USB Support -> Disabled
- Boot -> CSM Support -> Disabled
- Boot -> CFG Lock -> Disabled
- Settings -> IO Ports -> Above 4G Enconding -> Enabled
- Settings -> IO Ports -> Above 4GB MMIO BIOS assignment -> Enabled
- Settings -> IO Ports -> Re-Size Bar -> Enabled
- Settings -> Platform Power -> ERP Ready -> Enabled
- VT-D -> Enabled

### Cap4 USB 定制

看 [Why should you USB map](https://dortania.github.io/OpenCore-Post-Install/usb?ref=iiong.com) 就知道定制 USB 有天大的好处，不过此文档接近定制 USB 问题很繁琐，还好 [USBToolBox](https://github.com/USBToolBox/tool/?ref=iiong.com) 工具出来拯救手残党，不过使用这个工具必须在 `Windows` 环境下，根据 `USBToolBox` 文档介绍，此工具定制分为俩种情况：

- 使用 Apple 原生类，会根据机型（`SIMBIOS ID`）生成专用的 USBMap.kext
- 使用 USBToolBox 自有类，会生成通用的 UTBMap.kext，需要配合 [USBToolBox.kext](https://github.com/USBToolBox/kext?ref=iiong.com) 一起使用

所以上面驱动我使用了原生类，因为原生类性能偏好，坏处就是要自己定制，不一定合适其他人的设备，除非你和我型号一摸一样。注意定制 USB 下面几个情况：

- USB 端口不要超过 15 个
- 蓝牙一定要内建，USBToolBox 可以选择 Port 并且修改内建类型，具体可以搜索资料学习

### Cap5 显卡优化

由于 6000 系列显卡，需要在 `boot-args` 添加 `agdpmod=pikera` 参数，否则无法正常显示。然后在 `DeviceProperties` 添加设备：

```xml
			
<key>PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)</key>
<dict>
	<key>@0,name</key>
	<string>ATY,Carswell</string>
	<key>@1,name</key>
	<string>ATY,Carswell</string>
	<key>@2,name</key>
	<string>ATY,Carswell</string>
	<key>@3,name</key>
	<string>ATY,Carswell</string>
	<key>device_type</key>
	<string>ATY,CarswellParent</string>
</dict>

```

虽然不懂原理，但后续在测试 `Geekbench` 跑分的时候，大概提升了接近 6000 分，看起来多少是有一点效果。

### Caps6 CPU 优化

在 `NVRAM` 添加数据进行修改处理器信息：

```xml
<key>4D1FDA02-38C7-4A6A-9CC6-4BCCA8B30102</key>
<dict>
	<key>revcpu</key>
	<integer>1</integer>
	<key>revcpuname</key>
	<string>20-Core Intel Core i7</string>
	<key>rtc-blacklist</key>
	<data></data>
</dict>

```

然后在 `Kernel` 修改仿冒十代 `CPU`：

- `Cpuid1Data`: `55060A00 00000000 00000000 00000000`
- `Cpuid1Mask`: `FFFFFFFF 00000000 00000000 00000000`

上面说到添加 `CpuTopologyRebuild.kext` 会处理大小核心，在 `boot arg` 需要添加 `-ctrsmt` 参数进一步优化功耗。

![geekbench](https://cdn.iiong.com/2024/05/geekbench.jpg)

![power-gadget](https://cdn.iiong.com/2024/05/power-gadget.jpg)

测试下来最大酷睿和最小酷睿运转正常。

### Cap7 声卡

主要参考资料是 `AppleALC` 的 `Supported codes` ：[https://github.com/acidanthera/appleALC/wiki/Supported-codecs](https://github.com/acidanthera/appleALC/wiki/Supported-codecs?ref=iiong.com)

然后根据自己声卡型号找到对应的 `id` 即可，在 `DeviceProperties` 添加设备写入下面代码：

```xml
<key>PciRoot(0x0)/Pci(0x1F,0x3)</key>
<dict>
	<key>AAPL,slot-name</key>
	<string>Internal@0,31,3</string>
	<key>device_type</key>
	<string>Audio device</string>
	<key>hda-gfx</key>
	<string>onboard-2</string>
	<key>layout-id</key>
	<integer>98</integer>
	<key>model</key>
	<string>Starship/Matisse HD Audio Controller</string>
</dict>

```

### ~~Cap8 蓝牙睡死~~

博通网卡蓝牙模块在目前系统 `macOS Ventura 13.6.6` 会出现问题，具体表现为睡眠唤醒后，蓝牙会出现睡死的情况，需要过几分钟时间才能正常。在网上搜了很久资料没有治本的方法，不知道根本原因在哪里，归纳为是博通网卡导致恐慌问题，为了解决此问题利用 `sleepwatcher` 程序监听系统睡眠和唤醒事件，然后在不同的事件触发 `blueutil` 蓝牙开关。

```bash
# 安装 sleepwatcher
brew install sleepwatcher

# 安装 blueutil，注意：使用 sudo pkill bluetoothd 无效，利用 blueutil 有效
brew install blueutil

# 在根目录下新建 2 个文件
cd ~
touch .sleep
touch .wakeup

# 授予 read, write, and execute 权限 for everyone
sudo chmod 777 .sleep
sudo chmod 777 .wakeup

# 查看 blueutil 路径，比如 /usr/local/bin/blueutil，后面用得到
which blueutil

# 利用 vim (vim .sleep) 往 .sleep 中写入内容，睡眠时关闭蓝牙
/usr/local/bin/blueutil -p 0
echo "[`date "+%Y-%m-%d %H:%M:%S"`] sleep $?" >> ~/.sleepwatcher.log

# 利用 vim (vim .wakeup) 往 .wakeup 中写入内容，唤醒时开启蓝牙
/usr/local/bin/blueutil -p 1
echo "[`date "+%Y-%m-%d %H:%M:%S"`] wakeup $?" >> ~/.sleepwatcher.log

# 运行服务，会弹窗要求一个系统权限，即：在 Privacy & Security > Input Monitoring 中添加 sleepwatcher，同意
brew services start sleepwatcher

# 查看进程，检查执行脚本的路径对不对，应该是 /Users/xxx/.sleep 和 /Users/xxx/.wakeup ，xxx 是用户名。
# 如果路径不对，你会发现没有日志，因为脚本根本没有执行
ps aux | grep sleepwatcher

#### 如果是 /Users/brew/actions-runner/_work/homebrew-core/homebrew-core/bottles/home/，这就
### 参考 <https://github.com/Homebrew/discussions/discussions/4231>
## 1. 重装 sleepwatcher
HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall sleepwatcher
## 2. 重启服务
brew services restart sleepwatcher
## 3. 查看进程，检查执行脚本的路径对不对
ps aux | grep sleepwatcher

# 查看 ~/.sleepwatcher.log 来验证是否执行了脚本，如果没有问题了，删除输出日志的命令和.sleepwatcher.log

```

> 此处已解决，配合二次睡眠

### Cap9 二次睡眠

这个问题是在开启 `Settings -> IO Ports -> Re-Size Bar` 选项导致的，如果关闭是正常，其实解决这个问题也简单，就是在 `boot args` 引导参数中添加 `npci=0x2000` 来解决此问题。

后续在[某个论坛](https://www.insanelymac.com/forum/topic/354899-system-hangs-every-second-sleep-cycle-alder-lake/?ref=iiong.com)发现这个问题，是大多数技嘉主板都会存在这个问题，除了降级没有其他方法了，除非未来技嘉能够升级 `BIOS` 估计来修复这个问题，但概率很低。目前暂时没有降级 `BIOS` 固件版本，先用 `npci=0x2000` 参数用着吧，目前开启此参数没有其他问题。

后续在升级 [BIOS 固件版本](https://www.gigabyte.com/Motherboard/B760M-AORUS-ELITE-rev-1x/support?ref=iiong.com#support-dl-bios) F20 后没遇到上面说的问题，目前测试下来睡眠和蓝牙都正常了，二次或者多次睡眠再唤醒也正常了。

> 之前主板有个 `XHCI Hand-off` 选项我一直是关闭状态，后续查了资料应该是要开启的，不确定这个选项会不会影响到睡眠，也没有深究下去。

> 同样 `ERP` 需要关闭，否则休眠会失效。