在Mac OS X中创建虚拟USB设备 [英] Creating virtual USB device in Mac OS X

查看:203
本文介绍了在Mac OS X中创建虚拟USB设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图以编程方式在Mac OS中添加带有驱动程序的虚拟USB设备. IOKit文档说:传统上,虚拟设备的驱动程序在IOResources上匹配,因为虚拟设备不会发布自己的文件.此类驱动程序的另一个示例是HelloIOKit KEXT(在使用Xcode创建设备驱动程序"中进行了描述),它在IOResources上匹配,因为它不控制任何硬件.

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?

推荐答案

您实际上想做什么?

如果要创建虚拟USB设备,则还必须创建虚拟USB设备将连接到的虚拟USB控制器(IOUSBController/IOUSBControllerV2/IOUSBControllerV3子类).控制器本身将在IOResources上匹配,并且必须模拟真实USB控制器的功能.虚拟控制器会假装检测其总线"上的虚拟USB设备,并为实际USB设备驱动程序提供与之匹配的设备/接口.这可能是很多工作-您确定您的虚拟设备必须是USB设备吗?

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?

这篇关于在Mac OS X中创建虚拟USB设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆