Inside of Virtual PC we provide a number of ’emulated’ devices – like the S3 Trio video card and the Intel 21140 network card. People regularly ask me why we emulate these specific devices – and there are a number of reasons. It is important to know that writing an emulated hardware device is relatively challenging – so the emulated devices we have were carefully chosen as it is a non-trivial task to change these devices.
- Compatibility – a very important consideration when looking at devices to emulate is how broadly supported it is. Today Virtual PC supports DOS through Windows XP, and OS/2. Further more Virtual PC is capable of running 100’s of other operating systems. With this in mind it would not be a good idea for us to emulate a device that did not have drivers available for all these platforms.
- Functionality – kind of a no-brainer, but the devices that we emulate need to provide *all* of the possible functionality that we need. For example – emulating a SCSI card that was not capable of clustering would have been a bad idea – as this was one of our primary motivations for emulating a SCSI card.
- Performance – we need to try and emulate devices that will provide the best performance for the virtual machine. And this is where things get complicated. One key concept to understand is that with an emulated device – the computation that would normally be performed by the physical device is actually performed by the computers CPU – with a significant performance overhead. This ends us up in the interesting scenario where a virtual machine’s emulated devices are actually competing with the virtual machine’s virtual processor for the same core resource – the physical CPU. Furthermore, as we emulate more and more advanced devices, they require more and more processing power to emulate. This means that emulating a more advanced device that would perform better in the real world can actually result in slower performance in the virtual world. At the end of the day we end up needing to choose the simplest possible device that provides the compatibility and functionality that we need.