sqrdevl / AptioFixPkg

AptioFixPkg drivers to workaround macOS compatibility with APTIO UEFI FW

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AptioFix

AptioFixPkg drivers fixing certain UEFI APTIO Firmware issues relevant to booting macOS.

WARNING: The code in this repository should be considered to be a proof of concept draft quality, and is only intended to be used as a software implementation guide. Due to the lack of time, this codebase may contain partially understood reverse-engineering samples, almost no documentation, hacks, and absolute ignorance of EDK2 codestyle.

AptioInputFix

Reference driver to shim AMI APTIO proprietary mouse & keyboard protocols for File Vault 2 GUI input support.

Features

  • Sends pressed keys to APPLE_KEY_MAP_DATABASE_PROTOCOL
  • Fixes mouse movement via EFI_SIMPLE_POINTER_PROTOCOL

AptioMemoryFix

Fork of the original OsxAptioFix2 driver with a cleaner (yet still terrible) codebase and improved stability and functionality.

Important Notes: To debug boot.efi errors on 10.13, aside the usual verbose (-v) boot-arg, you may need a boot.efi patch or an nvram preference. Either is necessary to get sensible error messages instead of 'does printf work??', but the patch may help in case you have issues when reading nvram.

Before using AptioMemoryFix please ensure that you have:

  • Most up-to-date UEFI BIOS firmware (check your motherboard vendor website).
  • Fast Boot and Hardware Fast Boot disabled in BIOS if present.
  • Above 4G Decoding or similar enabled in BIOS if present.
  • VT-d disabled in BIOS if present (you could also drop ACPI DMAR table with a bootloader).
  • CFG Lock (MSR 0xE2 write protection) disabled in BIOS if present (consider patching it otherwise if you have enough skills).
  • CSM disabled in BIOS if present (you may need to flash GOP ROM on NVIDIA 6xx/AMD 2xx or older, relevant material: #1, #2, #3).
  • EHCI/XHCI Hand-off enabled in BIOS only if boot stalls unless USB devices are disconnected.
  • VT-x, Hyper Threading, Execute Disable Bit enabled in BIOS if present.

Features (compared to the original)

  • Automatically finds the available memory region for boot.efi to use
  • Implements KASLR support for systems where certain slides cannot be used
  • Adds Safe Mode support on systems with used lower addresses
  • Ensures no slide argument leak to the operating system
  • Attempts to more properly handle the memory mappings
  • Implements new mapping code when waking from hibernation (still not stable enough)

Credits

About

AptioFixPkg drivers to workaround macOS compatibility with APTIO UEFI FW

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C 87.8%Language:C++ 5.8%Language:Assembly 5.5%Language:Shell 0.8%