-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CustomPciSerialDevice quirk doesn't work with default RegisterStride #2003
Comments
Hello! Thanks for providing the fixes. I have applied them. As for the codeless kext, could you please provide a new one? Since I am not familiar with that, I am not sure whether I can follow. |
I've attached the code-less kexts. PCIeSerial code-less kexts.zip PCIeSerialThunderboltEnable.kext will enable any PCIe serial port (PCI device class 7, sub-class 0) that is connected with Thunderbolt. For PCIeSerialDisable.kext, I needed to add a I was unable to use PCIeSerialThunderboltEnable.kext to enable one port for macOS while using PCIeSerialDisable.kext to disable the other port that is used for xnu kernel serial kprintf. The kernel stops printing to the serial port - the problem that PCIeSerialDisable.kext was supposed to prevent. Therefore, it may be necessary to not use PCIeSerialThunderboltEnable.kext if you want xnu to use a Thunderbolt serial port. In that case, PCIeSerialDisable.kext won't be necessary unless you have one of the PCIe serial port cards that works from Thunderbolt without PCIeSerialThunderboltEnable.kext. Other Thunderbolt PCIe serial port notes part 2If the Thunderbolt device goes to sleep, it may alter the serial port settings when it wakes so that you can no longer get readable serial data from xnu. In that case, you may want to disable sleep, or find a method that allows sleep without sleeping the Thunderbolt device. If you use PCIeSerialThunderboltEnable.kext without PCIeSerialDisable.kext then a serial program can fix the serial port settings, but you also have to do that every time you boot since Apple16X50Serial stops serial output when it loads. I suppose a kext can be used to reinitialize the serial port after wake, or after boot but allowing sleep/wake of the serial port would make it difficult to use serial kprintf to debug sleep/wake issues. |
Hello! Thanks for the late response. I have added link to your posts here for the new codeless kexts at acidanthera/OpenCorePkg@59fd524. Since it is kind of pointless to repeat your words in Configuration.pdf, I have only written brief introductions and put a link here. Shall we close this now? |
Yes, thank you. |
I have updated my iMac14,2 to OpenCore 0.8.0 (config converted from OCLP 0.4.4 to OpenCore 0.8.0). I am attempting to do macOS xnu serial kprintf for the first time from this computer using a PCIe serial port card in a Thunderbolt enclosure.
Issue 1
The first issue is that
FindSerialPort.command
is not outputting the result. The following change should fix that.Find:
Replace:
FYI, The output for a PCIe Serial Port in a Thunderbolt enclosure looks like this:
The PCIe card has two serial ports, so there's two device paths in the result. I am using the first device path. It has 33 bytes which fits in the 40 byte limit. There's an extra pci-bridge since I'm using a Sonnet Echo Express III-D which has 3 slots.
Main Issue
The main issue is that the OpenCore CustomPciSerialDevice quirk doesn't do anything if the RegisterStride is 1. To fix this, make the following changes:
Find in
CommonPatches.c
:Replace with:
Find in
OcConfigurationLib.c
:Replace with:
Other Thunderbolt PCIe serial port notes
Apple's serial port driver
Apple16X50Serial.kext
doesn't haveIOPCITunnelCompatible
set to true except for a pair of PCIe cards:https://pci-ids.ucw.cz/read/PC/1415/c101
https://pci-ids.ucw.cz/read/PC/1d0f 8250
so my PCIe card https://pci-ids.ucw.cz/read/PC/125b/9100 is not automatically enabled while in a Thunderbolt enclosure.
For Thunderbolt, I suppose a code-less kext can be made to enable any PCIe serial port card by defining an IOKit personality that matches the PCIe card using
IONameMatch
orIOPCIMatch
(or any PCIe serial port withIOPCIClassMatch
) and setsIOPCITunnelCompatible
to true and points to the Apple16X50Serial binary. Add additional matching criteria so that the serial port that is used for xnu serial kprintf is not matched. Or add an IOKit personality that matches the serial port that is used by xnu and make that personality point to IOService instead of Apple16X50Serial binary and make it have a higher probe score (like the PCIeSerialDisable.kext example mentioned in the OpenCore Reference Manual).The text was updated successfully, but these errors were encountered: