-
Notifications
You must be signed in to change notification settings - Fork 29
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
Compile with 10.11 sdk #78
Comments
I worked a bit on this already in #70 |
Plan is to keep code compilable on XCode 5 as it was, with SDK 10.9 and deploy target 10.9 But to also make it compilable with XCode 7 using SDK 10.11 and deploy target 10.11 The idea is to make adapters for several classes in 10.11, so that I do not have to modify the main bulk of the code. 10.9 does not need the adapters but in 10.11 the driver calls would be rerouted through the adapters that map the old 10.9 calls into the new 10.11 calls So far for the rough plan. The details will have some problems, I can not really see how far and rough that will get. |
I put in adapters for IOUSBPipe, IOUSBDevice, IOUSBInterface, IOUSBController, and a bunch of structures in USB.h: IOUSBIsocFrame, IOUSBLowLatencyIsocFrame, IOUSBLowLatencyIsocCompletionAction, IOUSBLowLatencyIsocCompletion, IOUSBEndpointDescriptor, IOUSBConfigurationDescriptor, IOUSBCompletionAction, IOUSBIsocCompletionAction, IOUSBIsocCompletion, IOUSBCompletion, IOUSBDevRequest, IOUSBDevRequestDesc This long list in USB.h might become the most troublesome part, as these are raw structures where the first ones are more or less function-based objects. |
guessing the new versions of old structures
It looks like in general the USB.h file has been replaced with IOUSBHostIOSource.h |
These structures look comparable but have slight differences. Eg
versus
|
Big thx Man! good news in morning) |
@digdelu thanks! On Yosemite the driver indeed was already working fine. This ticket is a working ticket for me to get it compile on El Capitan, in an attempt to get the low-latency connection back with El Capitan. |
apple changed the low latency 'busy' status from kUSBLowLatencyIsochTransferKey ('llit') to kIOReturnInvalid. It would not surprise me if this were the heart of the problem |
Trying to find substitute for IOUSBInterface#getInterfaceStringIndex() Checking Apple's source code where I see
|
s |
mBus in EMUUSBAudioDevice was not even used. Removed. |
Trouble replacing FindNextPipe was in IOUSBInterface but not in USBHostInterface.
which is too vague to use directly |
I will try to use code from |
the old struct specifying the required pipe properties was this
The suggested getNextEndpointDescriptor takes
|
This is the source code of the old FindNextPipe
|
Just guessed that the lib would have the name com.apple.kpi.vfs with version 13.4 minimum However that doesn't work
|
And I probably now need to link against IOUSBHostFamily, not IOUSBFamily, in the same plist OSBundleLibraries. |
Mmm, that gives
|
|
IOUSBHostFamil has version 1.0.1. Maybe that's why it didn't load
|
That gives me
But the other errs are now gone. Maybe this is the right track and that I have some refs, or implemented some stub incorrectly |
There is a ref to IOUSBInterface in the plist. Maybe that should be IOUSBHostDevice on 10.11 |
Trying to figure out where the IOUSBDevice reference comes from Using nm I see these refs in this order
The StreamInfo refs probably come from StreamInfo.cpp The next thing I recognise in the names is the IOUSBDevice1 code. Could it be that the ending on "1" confuses the linker ? |
StreamInfo code in start could be generalized with
|
Seems I screwed up something, 10.11 does not compile anymore. Seems XCode damaged the file, the modification time is today. All other files are from 27 aug 2015 |
Thanks to the open source on
I could figure out that 'utf8_encodestr' had been erased in my file, leaving jjust a list of parameters .... I dont understand why these files are writable. Will try to change that... |
When I compile for 10.9 and run kextutil -n I get a few warnings:
I should fix those |
The above warnings do not occur in 10.9. Must be that 10.11 has stricter check. on 10.9, there are these kext's
There IS NO Libm. Additionally, IOAudioFamily IS ALREADY requested, as version 1.9.7f2. |
I added vecLib to the OSBundleLibraries but still get the same error. |
OSBundleRequired is a separate element for the plist, which is not there currently. |
This driver is not needed during early boot. Not sure why the warnings are there but we probably can ignore them... |
If I only change in OSBundleLibraries the IOUSBFamily to IOUSBHostFamily, I get only these errors
Strange, the other errors ::metaClass are now gone |
Changed all occurences of IOUSBPipe to USBPipe just to be sure The problem with the linker complaint about Write stays. Strange that the compiler doesn't complain |
The problem is that the Write function is declared but not implemented. |
IOUSBHostPipe#io is replacing both read and write! I guess buffer->getDirection determines if it's read or write, but I could not find this documented. |
I need to find some solution for that plist. Having both this in the OSBundleLibraries com.apple.iokit.IOUSBFamily 683.4 and |com.apple.iokit.IOUSBHostFamily | 1.0.1 | is not an option. Hacking it in every time you compile for 10.11 is not nice either. |
Only remaining problem loading the kext is this
|
After some trial and error, the utf8_encodestr appears to be in the com.apple.kpi.bsd version 15.4.0 works but maybe I should use lower version nr in final version. |
The kext now is installing properly. Added a 2nd plist for 10.11 |
Compilation works, the driver loads. It doesn't work but I made a new ticket for that #80. Closing this |
Maybe the code can work again properly with low latency if we compile against the 10.11 SDK
The text was updated successfully, but these errors were encountered: