HoRNDIS icon indicating copy to clipboard operation
HoRNDIS copied to clipboard

Building on Sierra Fails

Open 4ydx opened this issue 8 years ago • 7 comments

I get the following error:

'IOKit/usb/IOUSBBus.h' file not found

Are the deploy packages not being built on a machine running Sierra or is there something I need to change/install?

4ydx avatar Oct 30 '17 02:10 4ydx

The API was removed..

https://developer.apple.com/library/content/releasenotes/General/APIDiffsMacOSX10_11/Objective-C/Kernel.html

Removed IOUSBBus Removed IOUSBBus::getMetaClass()

seems like it would have to be re-implemented using some new api??

tmagik avatar May 03 '18 17:05 tmagik

yeah, Apple rewrote the USB stack in 10.11 (and left in place a compatibility layer for which headers are not available, but for which the old headers would work).

If you want to use the new API, look at the additions on that page.

Alternatively you can use xcodelegacy to install the older SDKs.

d235j avatar May 03 '18 17:05 d235j

Is there any sort of implementation/migration guide for the USB stack rewrite? … If I had the source code I wouldn’t need to ask stupid questions on how to use equipment I paid a lot of money for :-/

On May 3, 2018, at 12:52 PM, David Ryskalczyk [email protected] wrote:

yeah, Apple rewrote the USB stack in 10.11 (and left in place a compatibility layer for which headers are not available, but for which the old headers would work).

If you want to use the new API, look at the additions on that page.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jwise/HoRNDIS/issues/73#issuecomment-386381250, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAQEI4pq6uN4jkYK2PWWRlC_iloe79Tks5tu0P5gaJpZM4QKlhA.

tmagik avatar May 03 '18 17:05 tmagik

There's documentation for the new API (IOUSBHostDevice, IOUSBHostInterface, and the rest) at https://developer.apple.com/documentation/kernel?language=objc, but I don't know of any migration guide, and source code for this stack is not available.

It might be worth putting in a radar ticket, but I don't know if that will lead to any responses, unfortunately.

d235j avatar May 03 '18 18:05 d235j

Yep. I filed a developer technical support request for it two or so years ago, and the answer was "we don't have any sample code for that, good luck, sucker". But if you have a patch set that actually brings us up to the latest APIs, that would be a good thing, I think.

jwise avatar May 03 '18 20:05 jwise

The latest version of "master" builds fine on Sierra or High Sierra. For all who are interested:

  • The new API is in the following headers:

#include <IOKit/usb/IOUSBHostDevice.h> #include <IOKit/usb/IOUSBHostInterface.h> #include <IOKit/usb/IOUSBHostFamily.h> #include <IOKit/usb/IOUSBHostPipe.h>

  • They are located in: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/usb/

  • The best source of documentation are the comments in the headers themselves. They also specify "a kind" of a migration guide in the form:

<code>virtual UInt16 IOUSBDevice::GetbcdUSB();</code><br> Replacement: <code>USBToHost16(getDeviceDescriptor()->bcdUSB);</code>

Note, the HoRNDIS itself was updated for the new API, but if you're up to hacking up something else, then have fun!

mikhailai avatar Jul 31 '18 08:07 mikhailai

These files work for Mac OS X, but what about trying to import/include + link against IOKit for iPhoneOS?

brandonros avatar Nov 17 '19 17:11 brandonros