OpenCorePkg Documentation

repository·master·Indexed 29 days ago

https://github.com/acidanthera/opencorepkg

A toolset for porting UEFI code to userspace and managing UEFI-based boot processes. Includes specialized drivers, hardware metadata decoders, and tools like GopStop for GOP testing, CrScreenshotDxe for UEFI screenshots, and OpenNetworkBoot for PXE and HTTP boot support.

Tokens
23.3K
Snippets
14
Records
193
Agent score
94%

What's inside acidanthera-opencorepkg

  1. Overview of OpenCorePkg and Acidanthera Libraries

    master

    OpenCorePkg is an OpenCore bootloader accompanied by a development SDK. The repository includes a collection of UEFI support libraries designed to provide supplemental functionality for Apple-specific UEFI drivers.

    Key capabilities provided by these libraries include:

    • Apple-specific support: Disk image loading, keyboard input aggregation, PE image signature verification, and XNU kernel driver injection/patching.
    • System Management: ACPI and SMBIOS manipulation, CPU information gathering, and audio management.
    • Utilities: Cryptographic primitives (SHA-256, RSA), decompression (zlib, lzss, lzvn), Plist parsing, and PNG manipulation.
    • Low-level helpers: UEFI variable abstractions, overflow-checking arithmetic, and text/graphics output implementations.
  2. Overview of EnableGop driver

    master

    EnableGop is a standalone GOP (Graphics Output Protocol) driver designed for EFI-era (~2009-2012) Mac Pro (4,1/5,1) and iMac firmware. It injects necessary OpenCore components into the firmware to provide pre-boot graphics support for non-natively supported GPUs.

    Capabilities enabled by the driver:

    • Native boot picker via the ALT key.
    • Firmware password UI.
    • Target disk mode UI.
    • macOS boot progress screen.

    Requirements:

    • An EFI-era Mac Pro or iMac with the most recent main firmware.
    • A GPU that does not produce native pre-boot graphics (e.g., no native picker before OpenCore starts).
    • A GPU that produces graphics when using OpenCore (must successfully show the Apple boot picker via BootKicker.efi).

    Warning: This is a Beta release. Incorrect installation can brick your hardware. Always back up your main or GPU firmware before proceeding and ensure you have a reliable recovery method (e.g., SOIC clip and CH341A controller).

  3. Identify available Acidanthera libraries

    master

    The OpenCorePkg repository provides a wide range of specialized libraries for UEFI development, focusing on Apple-specific protocols, security, and system management. Key functional categories include:

    Apple-Specific Support

    • ACPI & Kernel: OcAcpiLib (injector/patcher), OcAppleKernelLib (kernelspace injector/patcher).
    • Boot & Security: OcAppleBootPolicyLib (Apple bless protocol), OcFirmwarePasswordLib (Apple firmware password protocol).
    • Hardware & Data: OcDataHubLib (DataHub configuration), OcSmbiosSmbiosLib (SMBIOS data), OcAppleChunklistLib (chunklist handling for DMG hashes).
    • Disk & Files: OcAppleDiskImageLib (DMG as UEFI RAM disk).

    Core UEFI & System Utilities

    • Data & Serialization: OcConfigurationLib (OpenCore config deserialization), OcSerializeLib (PLIST deserialization), OcXmlLib (XML/PLIST reading), OcStringLib (string management).
    • Security & Crypto: OcCryptoLib (AES, RSA, MD5, SHA-1, SHA-256).
    • Filesystem & I/O: OcFileLib (supplemental I/O), OcVirtualFsLib (UEFI filesystem interception), OcStorageLib (resource storage abstraction).
    • System Management: OcBootManagementLib (blessed-based boot management with UI), OcCpuLib (CPU feature scanning), OcRtcLib (CMOS access), OcTimerLib (TSC-based timer).

    Low-Level & Development Tools

    • Safety & Debugging: OcGuardLib (sanity checking, overflow math), OcDebugLogLib (debug output redirection).
    • Image & Binary Handling: OcMachoLib (Mach-O handling), OcPeCoffExtLib (EFI image management), OcPngLib (PNG decoding).
    • Device & Pathing: OcDevicePathLib (device path management), OcDevicePropertyLib (Apple device property protocol).
  4. Verify Apple EFI binary signatures with AppleEfiSignTool

    master

    AppleEfiSignTool is an open-source utility used to verify digital signatures on Apple EFI binaries. It supports both Apple Fat binaries and standard PE images.

    Key Capabilities:

    • Verifies digital signatures for Apple Fat binaries.
    • Verifies digital signatures for Apple PE images.
    • Extracts and displays APFS version information if the image is identified as an APFS driver.
    • When using the -f option, the tool displays information regarding W^X (Write XOR Execute) and section overlap fixups.
  5. Integrate zlib into OpenCore via OcCompressionLib

    master

    OcCompressionLib is a modified version of zlib (based on v1.2.13) adapted for smooth integration into the OpenCore bootloader. To use this library, you must include the specific header and source files listed in the [Sources] section of OcCompressionLib.inf and ensure the following modifications are applied:

    • inflate.c: Uses the OC_INFLATE_VERIFY_DATA macro for optimized performance.
    • zconf.h: Uses OpenCore's specific configuration header.
    • zlib_uefi.c: A custom UEFI implementation provided by OpenCore.
    • zutil.c: A simplified version containing only z_errmsg.
    • zutil.h: Contains memory function aliases that map to UEFI counterparts.