Creating virtual USB device in Mac OS X

北慕城南 提交于 2020-08-02 05:05:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!