jeudi 29 mai 2014

OSX - Custom USB Driver for Windows ? Mac ? -Débordement de pile


I'd like to modify a USB driver to send and receive USB data over a network.


Take for example, an iMac and a PC. I have an iPod plugged in to my PC (in NY). I want my iMac (in LA) to recognize the iPod as plugged in to a local USB port and be able to communicate with the iPod.


Forget my qualifications, or lack thereof (I have background in web, iOS apps, I've toyed with Java and C).


Where can I get source code for a USB driver for Windows that I can modify? Mac OS?


Any tips or pointers towards accomplishing my goal would be appreciated as well.




It looks like folks are coming up with something close to what you want. If you do decide to roll your own, the USB driver source you asked for is libusb.




On the Mac OS X end, drivers are built up in a stack. What you want to do should be relatively simple (nothing is really simple in kernel land). You need to create a driver that can communicate over ethernet with the PC and looks like a USB device to the driver matching software. Then everything else will happen automatically.


The source code is available for Apple's USB stack. You should also read about the IOKit API and IOKit device driver guidelines and IOKit fundamentals.


Oh yes and you say you have toyed with Java and C. To write device drivers on OS X, you'll need to learn some C++.




Sounds quite like this product, a bit unsure if theirs works over wide-area networks though.




I have a general idea of how I'd go about it, but not any specifics. Basically, I'd use the platform's driver development kit to write a USB device emulator on the client machine. I'd then add a virtual device to that system called "Networked USB Host", or something similar that maintains an open port to listen for communication from the server and passes it on to your virtual USB device. IIRC, the Windows DDK comes with a USB simulation framework that might be able to help you with this.


On the server, you'd have to hook into the USB subsystem to send raw USB packets to the client machine. libpcap and wireshark have USB capturing facilities for that, but I'm not sure if this works with winpcap and the Windows version of wireshark as well.


EDIT: Look at this for cross-platform USB capture alternatives.




You can buy OSR USB learning kit: https://www.osronline.com/custom.cfm?name=index_fullframeset.cfm&pageURL=https://www.osronline.com/store/index.cfm


This is actually small USB device with known interface. Windows Driver Kit (WDK) contains sample KMDF driver for this device: http://www.microsoft.com/whdc/driver/wdk/


This is good starting point to learn Windows Drivers development, and USB drivers development specifically. However, it is still far away from your problem solution.




Can't you use some sort of Remote Desktop?




I suggest you to go see USBIP project. This is available on Linux and Windows, but not clear for MAC. If you can get a VHCI-Controller driver installed for MAC, we can kick start USBIP for MAC.



I'd like to modify a USB driver to send and receive USB data over a network.


Take for example, an iMac and a PC. I have an iPod plugged in to my PC (in NY). I want my iMac (in LA) to recognize the iPod as plugged in to a local USB port and be able to communicate with the iPod.


Forget my qualifications, or lack thereof (I have background in web, iOS apps, I've toyed with Java and C).


Where can I get source code for a USB driver for Windows that I can modify? Mac OS?


Any tips or pointers towards accomplishing my goal would be appreciated as well.



It looks like folks are coming up with something close to what you want. If you do decide to roll your own, the USB driver source you asked for is libusb.



On the Mac OS X end, drivers are built up in a stack. What you want to do should be relatively simple (nothing is really simple in kernel land). You need to create a driver that can communicate over ethernet with the PC and looks like a USB device to the driver matching software. Then everything else will happen automatically.


The source code is available for Apple's USB stack. You should also read about the IOKit API and IOKit device driver guidelines and IOKit fundamentals.


Oh yes and you say you have toyed with Java and C. To write device drivers on OS X, you'll need to learn some C++.



Sounds quite like this product, a bit unsure if theirs works over wide-area networks though.



I have a general idea of how I'd go about it, but not any specifics. Basically, I'd use the platform's driver development kit to write a USB device emulator on the client machine. I'd then add a virtual device to that system called "Networked USB Host", or something similar that maintains an open port to listen for communication from the server and passes it on to your virtual USB device. IIRC, the Windows DDK comes with a USB simulation framework that might be able to help you with this.


On the server, you'd have to hook into the USB subsystem to send raw USB packets to the client machine. libpcap and wireshark have USB capturing facilities for that, but I'm not sure if this works with winpcap and the Windows version of wireshark as well.


EDIT: Look at this for cross-platform USB capture alternatives.



You can buy OSR USB learning kit: https://www.osronline.com/custom.cfm?name=index_fullframeset.cfm&pageURL=https://www.osronline.com/store/index.cfm


This is actually small USB device with known interface. Windows Driver Kit (WDK) contains sample KMDF driver for this device: http://www.microsoft.com/whdc/driver/wdk/


This is good starting point to learn Windows Drivers development, and USB drivers development specifically. However, it is still far away from your problem solution.



Can't you use some sort of Remote Desktop?



I suggest you to go see USBIP project. This is available on Linux and Windows, but not clear for MAC. If you can get a VHCI-Controller driver installed for MAC, we can kick start USBIP for MAC.


0 commentaires:

Enregistrer un commentaire