Using Virtual PC for USB Device Simulation

One of the advantages of device simulation is that you do not need real hardware to test your driver. As a result, you can use Microsoft Virtual PC and Microsoft Virtual Server for target test machines.

Testing on virtual machines offers the following benefits:

  • You do not need a separate test machine.

  • You can save virtual machine state, so you can store a snapshot of the test machine in various stages of development and test.

  • Virtual machine state is stored in a file that you can transfer to other development machines.

  • You can attach a kernel debugger to a virtual machine.

DSF has been used extensively on virtual machines (and in fact much of DSF was developed by using Microsoft Virtual PC on a laptop), and it typically works very well. The following list describes some "tips and tricks" for using a virtual machine with device simulation:

  • Allocate at least 512 MB of physical memory to the virtual machine.

  • When stopped in a kernel debugger, the virtual machine will use a large amount of CPU time because it is simulating a real system that is waiting for debugger input on the serial port or other communication line. If you need to do work outside of the debugger while the system is stopped in the debugger, pause the virtual machine and then resume it again later when you are ready to continue debugging.

  • Have a version of the virtual machine state with the DSF runtime and any other tools or static state installed (for example, Debugging Tools for Windows and Visual Studio). This allows you to start a debugging session with a clean machine every time. When a virtual machine gets into an unusable state, you can simply close it without saving state and then restart with the clean state

 

 

Send comments about this topic to Microsoft

Build date: 9/21/2010