> ## 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.

# 使用 OpenCore 引导黑苹果
- URL: https://iiong.com/booting-hackintosh-with-opencore/
- Published: 2020-04-12T14:28:36.000Z
- Updated: 2026-06-22T15:31:41.000Z
- Description: 之前使用 Clover 作为系统系统引导，再加上本身接触的比较晚，查阅很多资料都是老版本，包括一些驱动什么的，版本众多，看着迷糊，虽然使用没啥问题，无奈有时间遇到一个小问题需要花大量的时间去查找寻找时间，所以这段时间尝试使用 OpenCore 作为新的系统引导（下文简称 OC）。
- Author: 淮城一只猫
- Tags: 奇技淫巧

### 前言

之前使用 `Clover` 作为系统系统引导，再加上本身接触的比较晚，查阅很多资料都是老版本，包括一些驱动什么的，版本众多，看着迷糊，虽然使用没啥问题，无奈有时间遇到一个小问题需要花大量的时间去查找寻找时间，所以这段时间尝试使用 `OpenCore` 作为新的系统引导（下文简称 `OC`）。因为 `OC` 出世不长，有些资料版本比较新，很适合像我这种不需要了解某个事物历史等因素。还好这次入坑遇到不少人帮助，非常感谢一些朋友的帮助让我少走一点弯道，到此为止现在系统能够正常使用。

### 准备

前一段时间虽然成功，但因为网卡和显卡驱动问题一直拖到这个月，所以这次换了一部分硬件，不知道算是降级体验吗？

- 主板：微星 `Z370-OC-Pro` MS-7B48
- CPU：Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
- 显卡：~~NVIDIA GeForce GTX 1070 Ti~~ \=> 降级替换 蓝宝石 RX590 8G D5 超白金 极光特别版 （2304个流处理器）
- 磁盘：WDC WDS240G2G0A-00JH30 (240GB) / NVMe Asgard AN3 1TNVM (1.0TB) / ST2000DM006-2DM164 (2.0TB)
- 内存条：阿斯加特 - 16.0GB
- 板载网卡：Realtek PCIe GbE Family Controller
- 无线网卡：~~Killer(R) Wi-Fi 6 AX1650x 160MHz Wireless Network Adapter (200NGW)~~ \=> BCM94360CD
- 声卡：Realtek High Definition Audio
- 显示器：~~一个飞利浦 直面 1080P / 俩个三星 曲面屏 1080P~~ \=> 三星直板 4K 分辨率支持HDR 显示器 - 俩个

因为手里有三星设备，想体验`Sumsunng Dex` 系统，加上三星品控不错，所以入了三星显示器。至此为止，硬件基本满足黑苹果的需求，下面进行引导替换。由于这仅仅是替换引导，不需要对系统进行更换，所以只是替换 `EFI` 目录下的 `Clover` 引导而已。

首先需要准备一个刻录系统的优盘，这边可以参考下之前的 [刻录系统文章](https://iiong.com/document-my-installation-hackintosh-process/#cap2) ，如果你懒的话可以直接使用`磁盘工具` 格式化优盘：

- 名称随意编写，例如 `OC`
- 格式选择 `MS-DOS(FAT)`

这样且当做 `EFI` 分区，下面大部分操作就在这里面进行。

> 无论无何不能在系统安装的磁盘的 `EFI` 里进行修改操作，如果破坏无法进入系统真的完蛋了。
> 
> 其次要勤奋备份自己的 `EFI` 数据，因为折腾不容易，丢了又要从头开始。

### 转移

之前不知道在哪看到的，不管是 `Clover` 还是 `OpenCore` 引导驱动越少越好，较少对系统的干扰因素。所以当时制作引导，只保留最精简的驱动和配置。这边我不会细细讲解配置过程，因为网上的教程实在是太多了，可以参考下：[精解OpenCore](https://blog.daliansky.net/OpenCore-BootLoader.html?ref=iiong.com) 和 [使用OpenCore引导黑苹果](https://blog.xjn819.com/?p=543&ref=iiong.com) ，写得不错，看他们写的文章，花了三个小时搞定 `EFI` 引导。

当时版本：OpenCore-0.5.7

下载 `OC` 解压把 `EFI` 文件夹放到优盘下面，并且查看 `/EFI/OC` 文件夹下内容：

Drivers文件夹下:

| 驱动文件              | 解释                                                                        |
| ----------------- | ------------------------------------------------------------------------- |
| HiiDatabase.efi   | 用于给 Ivy Bridge (3 代酷睿) 或更老代主板上支持 UEFI 字体渲染, UEFI Shell 中文字渲染异常时使用, 新主板不需要 |
| NvmExpressDxe.efi | 用于在 Haswell (4 代酷睿) 或更老的主板上支持 NVMe 硬盘, 新主板不需要                             |
| OpenCanopy.efi    | 实现图形界面，一般用于主题                                                             |
| OpenRuntime.efi   | 内存寻址补丁                                                                    |
| OpenUsbKbDxe.efi  | 键盘组合键的使用                                                                  |
| XhciDxe.efi       | 用于给 Sandy Bridge (2 代酷睿) 或更老的主板上支持 XHCI, 新主板不需要                           |

综合上述，只保留 `OpenRuntime.efi` 文件，其他可以删除，当然把 `OpenCanopy.efi` 保留下来。然后额外添加

| 驱动文件                 | 解释       |
| -------------------- | -------- |
| ApfsDriverLoader.efi | APFS格式支持 |
| HFSPlus.efi          | HFS格式支持  |

下面整内核驱动 `Kext`：

| 内核驱动               | 解释                                                                                                      |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| Lilu.kext          | Acidanthera 驱动底层依赖 [Github](https://github.com/acidanthera/Lilu/releases?ref=iiong.com)                 |
| Applealc.kext      | 声卡驱动 [Github](https://github.com/acidanthera/AppleALC/releases?ref=iiong.com)                           |
| VirtualSMC.kext    | 传感器驱动依赖 [Github](https://github.com/acidanthera/VirtualSMC/releases?ref=iiong.com)                      |
| SMCProcessor.kext  | CPU 核传感器 [Github](https://github.com/acidanthera/VirtualSMC/releases?ref=iiong.com)                     |
| SMCSuperIO.kext    | IO 传感器 [Github](https://github.com/acidanthera/VirtualSMC/releases?ref=iiong.com)                       |
| WhateverGreen.kext | 核显 & 显卡驱动 [Github](https://github.com/acidanthera/WhateverGreen/releases?ref=iiong.com)                 |
| IntelMausi.kext    | Intel 类千兆网卡驱动（如果是用无线网卡可以不需要） [Github](https://github.com/acidanthera/IntelMausi/releases?ref=iiong.com) |
| Usbinjectall.kext  | USB 通用驱动 [Github](https://github.com/Sniki/OS-X-USB-Inject-All?ref=iiong.com)                           |
| NVMeFix.kext       | 为 NVME 硬盘增加 ASPT 属性来保证节电 [Github](https://github.com/acidanthera/NVMeFix/releases?ref=iiong.com)        |

将刚刚解压的 `OC` 文件夹下的 `Docs/Sample.plist` 文件重命名放入 `EFI/OC/config.plist` ，和 `ACPI` 文件夹同级。使用 `Xcode` 或者 `PlistEdit Pro` 打开 `config.plist` 删除上面的无用注释 `#WARNING - #` 。如果这类文本编辑器看着不直观可以使用 `OCC` 编辑器进行管理：[文档介绍](https://mackie100projects.altervista.org/opencore-configurator/?ref=iiong.com) 。

然后根据上面的教程对自己配置进行一步个性化配置，这边不多说了。值得注意的时候，注意三码要一样，不然出现丢失 `Apple ID` 的问题，其次切换引导需要清除 `NVRAM` 再进入系统。

### 完善

#### 声卡

在 `config.plist/DeviceProperties/` 的 `PciRoot(0x0)/Pci(0x1f,0x3)` 有个 `Layout-id` 属性注入自己的 `Codecs` ，更多教程查看：[AppleALC支持的Codecs列表及AppleALC的使用](https://blog.daliansky.net/AppleALC-Supported-codecs.html?ref=iiong.com) 。

#### 核显加速

由于是独显输出，核显就拿来加速吧：在 `config.plist/DeviceProperties/` 的 `PciRoot(0x0)/Pci(0x2,0x0)` 有个 `AAPL,ig-platform-id` 填入值是：`0300983E ` ，当时没理解这个，原来是固定值。如果没有独显，需要核显驱动视频那需要根据自己的 `CPU` 平台进行注入 `GPUID`：[Coffee Lake帧缓冲区补丁及UHD630 Coffee Lake ig-platform-id数据整理](https://blog.daliansky.net/Coffee-Lake-frame-buffer-patch-and-UHD630-Coffee-Lake-ig-platform-id-data-finishing.html?ref=iiong.com) 。

#### USB 3.0 定制

当初在屏蔽 USB2 死活屏蔽不了，然后发现是 `Usbinjectall.kext` 驱动下错了，应该是 @Sniki 维护的 [Usbinjectall.kext](https://github.com/Sniki/OS-X-USB-Inject-All?ref=iiong.com) 驱动，剩下可以参考：[Hackintool 使用教程及插入姿势](https://blog.daliansky.net/Intel-FB-Patcher-tutorial-and-insertion-pose.html?ref=iiong.com)。值得注意是这边只需要最后生成的 `USBPorts.kext` 驱动放入 `Kexts` 文件夹下，并且禁用 `USBInjectAll.kext` 驱动即可。

#### CPU 变频

参考 [CPUFriend的安装与使用](https://blog.daliansky.net/CPUFriend-Installation-and-Usage.html?ref=iiong.com) ，不过这个文章没有说出 `System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources/` 哪个 `plist` 文件，这边是你的 `board-id` 名字的文件，终端输入：

```bash
➜  ~ ioreg -l | grep board-id          
    |   "board-id" = <"Mac-63001698E7A34814">

```

然后进行文章的操作。

#### USBX供电

添加 `USBPower.kext` 驱动即可

#### CPU 电源管理

参考：[注入X86](%5Bhttps://github.com/daliansky/OC-little/tree/master/05-%E6%B3%A8%E5%85%A5%E8%AE%BE%E5%A4%87/05-1-%E6%B3%A8%E5%85%A5X86%5D%28https://github.com/daliansky/OC-little/tree/master/05-%E6%B3%A8%E5%85%A5%E8%AE%BE%E5%A4%87/05-1-%E6%B3%A8%E5%85%A5X86%29)

#### 节能五项

`SSDT-PM.aml`

```bash
/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20200110 (64-bit version)
 * Copyright (c) 2000 - 2020 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of iASL2s2csv.aml, Sun Apr 12 22:14:00 2020
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x000000C6 (198)
 *     Revision         0x02
 *     Checksum         0xC2
 *     OEM ID           "ACDT"
 *     OEM Table ID     "PM"
 *     OEM Revision     0x00001000 (4096)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20180427 (538444839)
 */
DefinitionBlock ("", "SSDT", 2, "ACDT", "PM", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)
    External (_SB_.PCI0.PMCR, DeviceObj)

    Device (PPMC)
    {
        Name (_ADR, 0x001F0002)  // _ADR: Address
        OperationRegion (PMCB, PCI_Config, Zero, 0x0100)
        Field (PMCB, AnyAcc, NoLock, Preserve)
        {
            VDID,   32, 
            Offset (0x40), 
            Offset (0x41), 
            ACBA,   8, 
            Offset (0x48), 
                ,   12, 
            PWBA,   20
        }
    }

    Scope (_SB.PCI0.LPCB)
    {
        Device (PMCR)
        {
            Name (_HID, EisaId ("APP9876"))  // _HID: Hardware ID
            Name (_STA, 0x0B)  // _STA: Status
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0xFE000000,         // Address Base
                    0x00010000,         // Address Length
                    )
            })
        }
    }
}

```

#### 原生 NVRAM 支持

修改 `config.plist` 支持：

- Booter → Quirks → DisableVariableWrite = no
- Misc → Security → AllowNvramReset = yes
- Misc → Security → ExposeSensitiveData = 3
- NVRAM → LegacyEnable = no

添加 `DSDT` 补丁`SSDT-PMC.dsl`：

```bash
/*
 * Intel 300-series PMC support for macOS
 *
 * Starting from Z390 chipsets PMC (D31:F2) is only available through MMIO.
 * Since there is no standard device for PMC in ACPI, Apple introduced its
 * own naming "APP9876" to access this device from AppleIntelPCHPMC driver.
 * To avoid confusion we disable this device for all other operating systems,
 * as they normally use another non-standard device with "PNP0C02" HID and
 * "PCHRESV" UID.
 *
 * On certain implementations, including APTIO V, PMC initialisation is
 * required for NVRAM access. Otherwise it will freeze in SMM mode.
 * The reason for this is rather unclear. Note, that PMC and SPI are
 * located in separate memory regions and PCHRESV maps both, yet only
 * PMC region is used by AppleIntelPCHPMC:
 * 0xFE000000~0xFE00FFFF - PMC MBAR
 * 0xFE010000~0xFE010FFF - SPI BAR0
 * 0xFE020000~0xFE035FFF - SerialIo BAR in ACPI mode
 *
 * PMC device has nothing to do to LPC bus, but is added to its scope for
 * faster initialisation. If we add it to PCI0, where it normally exists,
 * it will start in the end of PCI configuration, which is too late for
 * NVRAM support.
 */
DefinitionBlock ("", "SSDT", 2, "ACDT", "PMCR", 0x00001000)
{
    External (_SB_.PCI0.LPCB, DeviceObj)

    Scope (_SB.PCI0.LPCB)
    {
        Device (PMCR)
        {
            Name (_HID, EisaId ("APP9876"))  // _HID: Hardware ID
            Method (_STA, 0, NotSerialized)  // _STA: Status
            {
                If (_OSI ("Darwin"))
                {
                    Return (0x0B)
                }
                Else
                {
                    Return (Zero)
                }
            }
            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
            {
                Memory32Fixed (ReadWrite,
                    0xFE000000,         // Address Base
                    0x00010000,         // Address Length
                    )
            })
        }
    }
}

```

编译 `SSDT-PMC.aml` 文件加入 `ACPI` 补丁支持。

#### OC 主题支持

主题资源：[OcBinaryData](https://github.com/acidanthera/OcBinaryData?ref=iiong.com)

添加主题驱动支持：`EFI -> OC -> Drivers -> OpenCanopy.efi`

- Misc-其它设置 → Boot → PickerMode 启动菜单模式: External
- Misc-其它设置 → Boot → PickeraTtribute 图形界面设置属性: 1
- UEFI-UEFI设置 → UEFI驱动，添加`OpenCanopy.efi`项

未完待续...

### 分享

个人自用 EFI 分享地址：[个人网盘](https://m.i95.me/Hackintosh?ref=iiong.com)

![](https://img.alicdn.com/imgextra/i4/2038135983/O1CN01du9QUp1u4GFqsMhzg_!!2038135983.png)

![](https://img.alicdn.com/imgextra/i4/2038135983/O1CN01Yupk7F1u4GFuVE7te_!!2038135983.png)