OpenCore added a quirk to enable the macOS xnu kernel to use a serial port other than the default COM1 port.
- acidanthera/bugtracker#1954
- acidanthera/OpenCorePkg#330
- acidanthera/OpenCorePkg#331
- acidanthera/bugtracker#2003
- https://github.com/acidanthera/OpenCorePkg/commit/59fd52487970a66def8b7fac71b10859902f3f55
The purpose of the original version of PCIeSerialDisable.kext (created in one of the above links) is to block the serial port from being used by macOS user apps so that the kernel could continue to use it for logging. It was a codeless kext containing an Info.plist file with one IOKit personality that matches the single PCIe serial port that was reserved for xnu by OpenCore. It blocks Apple's serial port driver from matching the same serial port which would have stopped the serial port from working until it was opened by an app. This worked on my iMac14,2.
On my Macmini8,1, the original version of PCIeSerialDisable.kext is not sufficient in keeping the serial port enabled for xnu.
I have not tracked down the process that disables the serial port (probably PCIe/Thunderbolt enumeration?). This new version contains code to reenable the serial port just in case it was disabled.
Since the kext now includes code, The OpenCore config.plist needs to include the new binary information:
<dict>
<key>Arch</key> <string>Any</string>
<key>BundlePath</key> <string>PCIeSerialDisable.kext</string>
<key>Comment</key> <string>PCIeSerialDisable</string>
<key>Enabled</key> <true/>
<key>ExecutablePath</key> <string>Contents/MacOS/PCIeSerialDisable</string>
<key>MaxKernel</key> <string></string>
<key>MinKernel</key> <string></string>
<key>PlistPath</key> <string>Contents/Info.plist</string>
</dict>
Another issue for my Macmini8,1 is that serial_init
does not get called or it doesn't enable xnu serial port output. For this, I made Lilu.kext call serial_init
itself.
- Allow this to work when an eGPU or other Thunderbolt devices are connected. This may require conversion to a Lilu dependant kext which can redo the xnu serial port quirk of OpenCore if the PMIO address of the serial port changes.