Why we emulated the devices that we do?

Rate This
  • Comments 16

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.

  1. 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.
  2. 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.
  3. 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.


Leave a Comment
  • Please add 3 and 2 and type the answer here:
  • Post
  • I don't think the performance angle is as clear cut as you say. Firstly you can offload to devices or optimised code sequences on the host computer. One example would be drawing ellipses on the graphics card. If the card you emulate cannot draw them, then the guest OS will sit there drawing it pixel by pixel. On the other hand if the emulated card can draw ellipses you can recognise that instruction and tell the host card to draw an ellipse. In all cases, the host CPU or the host graphics card drawing the ellipses will be faster than the guest OS drawing them pixel by pixel. (BTW I think you got the video card right in VPC).

    Similar things will apply for other hardware (eg TCP checksums on network cards). For disk controllers you'd want to emulate a card that can be supplied multiple outstanding large requests so you can hand that off to the host operating system to deal with. The host is way better at scheduling the real CPU, memory, hard disk and other peripherals and can do concurrently.

    You also have the option of emulating two devices. One can be based on real hardware meeting the criteria you give above, and the other can be optimised for VPC and require specific guest device drivers. VMWare do this for network cards (although bizarrely only for the Linux hosted version, not the Windows hosted version). You can set whether each emulated network card is the emalated AMD PCNet 32 or the vmxnet one.
  • Was performance the reason you emulated the Intel 21140 instead of an Intel 8255x (say a Pro 100B)?

    As the 8255x family is probably the most common PCI network card in existence. I had never seen nor heard of an Intel 21140 before messing with Virtual Server.

    I like the idea of a choice of hardware emulation, it seems like it might make migrating from physical hardware to a virtual machine easier.
  • The 21140 predecessors were also packaged up by DEC (prior to becoming Compaq prior to becoming HP). I encountered many many of them as real hardware.

    Note that I wasn't advocating choosing between two real pieces of hardware. It was between one real piece and one virtual (never existed) where the latter requires VPC specific device drivers. That gives you a choice between maximum compatibility and maximum performance.
  • I have one specific question about the emulated sound card . Many DOS games require the information which interrupt&port&DMA the sound card is using. We're either required to set a environment variable "BLASTER" or given a setup tool to select from a list of choices. So what is these settings to the VPC sound card?
    Also is there a DOS driver for the emulated sound card?
  • try this one:
    set BLASTER=A220 I5 D1 H5 P330 T6
    I even got the SB16 Driver for Windows 3.1x to work, so that I could run WinPlay3 for listening to an mp3. :)

    And I also think the choise of the DEC 21x4x is very nice, too because now I can run the QNX 1.44 Floppy Challenge. A full Operating System (QNX 4), a GUI, a Webbrowser and Webserver on one floppy disk. The network version supports three nic's: 3c509, ne2k and dec 21x4x. And it's quite fun to surf the net for a while with it, even though it's from about '98/'99. It's a bit hard to get, since QNX has stopped it's distribution, but it's available on the Ultimate Boot CD (http://www.ultimatebootcd.com).
  • That's very useful information. Many thanks SvOlli
  • Here's a question. Why not emulate Intel graphics, so there can be Direct3D and OpenGL support as well (only the most basic of course...)?
  • Robert -

    The DEC 21140 chipset is an older chipset and as a result has better support for legacy platforms.

    Th2 -

    This comes back to the performance issue - and Intel graphics chipset is much more complex than the S3 Trio - and hence overall performance would be slower.

  • As far as networks are concerned, I don't really mind which hardware is emulated. Unfortunately, I cant find one that does 100-baseTX or Gbit.

    Any chance an upgrade?
  • Okay, if Intel Graphics is too much, then why not do an ATI MACH64? Or perhaps an 8 MB Matrox Millenium card? Why not emulate 3D graphics (Direct3D and OpenGL), so that legacy games will not run too fast in a modernized computer system?
  • I wish there was a win3.xx driver for the i21140 nic,I can take my actual vintage p166 dos box online with an NC100 nic(it has a 3.xx driver)but not my virtual machine.Doesn't matter that it's obsolete,it should still work in 3.xx with ie5 16bit.

  • Htos1 -

    You can read about where to get the drivers (and how to setup networking on Windows 3.11) here: blogs.msdn.com/.../networking-windows-3-11-under-virtual-pc.aspx



  • How about GPIB (IEEE-488)bus?

    Is it supported in a virtual machine?

    I have a test PC that has Windows 7 that I need to virtualize to XP mode.

    My plan after virtualization is to connect the PC to spectrum analyzer, signal generator, power supply, and call box through GPIB cables.

    Do you think GPIB bus would be detected by a virtualized machine?



  • Is there anyway to write our own emulated hardware?

  • Bloss -

    No, this is not possible



Page 1 of 2 (16 items) 12

Why we emulated the devices that we do?