问题
I tried to add virtual usb device with driver in Mac OS programmatically. IOKit documentations says: Traditionally, drivers of virtual devices match on IOResources because virtual devices do not publish nubs of their own. Another example of such a driver is the HelloIOKit KEXT (described in “Creating a Device Driver with Xcode”) which matches on IOResources because it does not control any hardware.
But I don't found way to add virtual device in system. How can I do that?
回答1:
What are you actually trying to do?
If you want to create a virtual USB device, you will also have to create a virtual USB controller (IOUSBController
/IOUSBControllerV2
/IOUSBControllerV3
subclass) to which the virtual USB device would be attached. The controller itself would match on IOResources
and would have to emulate the functionality of a real USB controller. The virtual controller would pretend to detect the virtual USB device on its "bus", and offer the device/interface nubs up for real USB device drivers to match against. This is probably a lot of work - are you sure your virtual device must be a USB one?
来源:https://stackoverflow.com/questions/20064648/creating-virtual-usb-device-in-mac-os-x