I have a weird question. I would like to make a virtual copy of a device. In order to test some software I want to make a mirror copy of a particular scanner. Now I know there are some virtual TWAIN scanners out there, but I want Windows to recognise it as a particular brand and type just so I can test the particular software that comes with it.
I.e. I have an HP scanner plugged in, I want to make a mirror copy of it, unplug it and windows will still detect it as plugged in and operating normally so I can open the scanner software and driver. My goal is to make this virtual device stick, even on reboot. Is there any way this can be achieved? I'm happy to load the device data on an USB drive if that works as workaround.
I hope you guys can help me!
Cheers,
Jasper
You probably could do that by writing your own kernel-mode Windows driver that pretends to be a USB hub and pretends that it has a device plugged in to it which is a virtual scanner. Writing Windows drivers usually involves a lot of arcane C programming and it is unlikely that anyone will be able to tell you everything you need to do on this type of site.
Related
Step by step:
My PC has connected printer via USB (I know VID:XXXX and PID:YYYY)
I took image of my PC and put inside virtual machine (VMWare)
Of course image on my VM doesn't has connected USB-printer (because real printer is connected to my real USB-port on my real PC).
One program is running and checking accessibility of printer by check connection with the printer via USB (I don't know how exactly - maybe via WMI, maybe via other way).
Results:
a) on my real PC this program works
b) on image doesn't work
QUESTION: is possible to emulate on VM-side that USB-port (VID:XXXX and PID:YYYY) is alive?
Thanks.
P.S. I don't want to install USB-redirect-via-TCP or similar approach.
You should switch to the QEMU emulator and to Linux to do that. VMWare probably doesn't support this of thing especially in a Windows environment.
If you are already on Linux, QEMU has hardware emulation of the xHCI and you can assign the host USB devices to KVM (read here: https://www.linux-kvm.org/page/USB_Host_Device_Assigned_to_Guest).
On Windows, I don't think this will be possible.
I'm a bit new in UEFI driver development.
I have an UEFI application-bootloader that checks all USB tokens that are currently present in system. It works ok on hardware and Vmware VM, but I would like to test in NT32 emulator from EDK2 to be able to use source-level debugging.
Vmware has required feature for forwarding any removable device from host to VM. I try to do the same for NT32.
Have anyone worked on this issue before? Is it possible to forward USB token? Or maybe this token can be emulated somehow?
Continuous searching haven't gave me much information.
I suspect that it can be done with some tricky settings in package file Nt32Pkg/Nt32Pkg.dsc.
Possibly gEfiNt32PkgTokenSpaceGuid.PcdWinNtPhysicalDisk or gEfiNt32PkgTokenSpaceGuid.PcdWinNtVirtualDisk parameters can be useful, but I'm not sure.
Thanks everyone in advance for your efforts.
I would like to know if there is a program for analyzing traffic through USB. For example, I would like to know what files are transmitted from the computer to the device at the moment, what he does with the device. I need it to debug device, not driver! Is there such a program?
I think you can use this site as a starting point and inspect the different methods in detail on your own.
wireshark wiki
I've seen programs like magicdisc create virtual cd drives and mount them on the machine. How do these programs trick the operating system into thinking there is a new hardware device attached to it?
I imagine I would have to write a driver for the virtual hardware, and I am comfortable in C so that doesn't sound terrible, but how do I make the OS think there is a piece of hardware attached to it that isn't?
Thanks!
Usually the operating system has different layers and libraries, at some point there is a library that sits between something above it and the actual hardware, you fake it there, if there is some sort of read sector call, you pretend to read a sector using that sector address, read it from a file, whatever. Each operating system (windows, linux, etc) may do things a different way.
Probably you are familiar with C as application level, which is above OS.
The virtual driver is a piece a software, but need to write in proper locations the settings: Registry at Windows, some config file at some Linux. You need to handle OS level calls and callbacks at Kernel level. Than you will desire the software too to communicate with your device, probably integrated into OS Shell. At least 2 layes will be , if not 3 or more.
For eg windows xp you can make a virtual graphic card(and intercept various things), for Vista not, just with a trick :)
It is very-very OS specific.
I'm trying to connect a usb sensor (see Toradex) to an android phone (Desire Z) running android 4.0.3.
To test this, I wrote a small app to enumerate the attached device(s).
This supposed to have USB HOST mode implemented and to power the usb sensor (HID)... but it doesn't.
I got a USB OTG cable and now, when I attach the cable, a small icon appears in the status bar (car mode).
I'm disappointed since I waited for this feature for awhile now...
Any thoughts? I read almost everything out there related to this (Sven work and whatnot) but I might have missed something...
Thanks!
I have worked a lot in the past year and a half to build custom android platform. Some was under Froyo but mostly on Gingerbread. Most on the hardware I added was on either a UART or on USB, which is what you want to do. Unfortunately, it is not as easy to add a USB peripheral on an Android device than on a PC or a MAC. PCs and MACs have virtually unlimited memory space (hard drive). They can hold the drivers of a very large number of devices. That makes it possible to do auto-detection and automatic loading of drivers. On an Android device, it is a lot more lean therefor, just the required drivers are stored on the device. Every time I added a new device, I had to compile the driver for my platform and make some modification in my configuration. It is also possible to load the driver as a module instead of compiling it with the kernel (gives a file.ko output). Although, the driver must have been written accordingly. But, you will have to install it by modifying the "init.rc" which requires root privilege.
here is a few link of question/answer about about drivers in Android. That should give you a little bit more info:
USB touchscreen driver
Hope it helps but unfortunately, it is quiet a lot of work do do.