A few months ago, I developed a trivial video miniport for use in Windows NT virtual machines. The primary goal was to improve display speed and get past the 800×600, 16 color display mode which is the maximum Windows NT (up to an including Windows 2000) can handle out of the box on “modern” hardware. The miniport is designed to work with the synthetic SVGA “hardware” emulated by VirtualBox.
A secondary objective was to write the miniport in such a way that as many Windows NT versions could be supported with a single binary. That objective was fulfilled beyond expectations; the driver binary works with every x86 version of NT from the initial July 1993 release of Windows NT 3.1 up to and including Windows 7 released in October 2009. Windows 8 appears to drop the video miniport interface and thus cannot be supported.
A test version of the video miniport is provided as a floppy image. The miniport can be installed from any directory, but a floppy image is typically the most convenient method.
The miniport driver works together with the FRAMEBUF.DLL display driver shipped with Windows NT. That causes a minor complication: in Windows NT 4.0 and later, FRAMEBUF.DLL is always installed on the system, but in NT 3.x it’s not. I have not found a way for the NT 3.x OEMSETUP.INF file to install FRAMEBUF.DLL from a drive (directory) different from the miniport itself. The NT setup keeps asking for FRAMEBUF.DLL in drive A: (assuming floppy installation) and does not allow the user to point to the NT installation CD (typically in drive D:) instead. As a workaround, the file FRAMEBUF.DL_ must be copied from the \I386 directory on the installation CD to the miniport installation directory (floppy image). It may be uncompressed, but that isn’t necessary. Needless to say, the copy of FRAMEBUF.DLL installed together with the miniport must match the NT version.
If anyone knows how to circumvent the above limitation, I’ll appreciate any pointers.
Important: Read the above note about FRAMEBUF.DLL before installation!
The installation procedure depends on the Windows NT version. For Windows NT 3.1, the Setup application must be used. Start the Windows NT Setup application, select Options/Change System Settings… and in the Display drop-down box, select (at the very end of the list) Other.
NT will ask for the driver path; assuming that the floppy image is in drive A:, simply accept the default. Once the OEMSETUP.INF file is processed, select the desired display mode.
After changing the display mode, a reboot is required. To change the display mode, the same procedure must be used. The first time the miniport is selecgted, NT will copy the required files. Next time, the currently installed driver can be used and the installation medium is not required.
On Windows NT 3.5x, the installation is different. The Display applet in the Control Panel must be used, as the Windows NT Setup application no longer allows display selection.
In the Display applet, click on the Change Display Type… button and the again on the Change… button. In the Select Device dialog, click on Other….
Windows will again process the OEMSETUP.INF file and add a list of new display models to the dialog. Choose one of them and click Install. Windows will provide an option to restart the system automatically after copying the required files.
Changing the display mode is easier in Windows NT 3.5x and can be done in the Display applet.
In Windows NT 4.0 and later, the miniport isn’t necessary. The VirtualBox Guest Additions may be used to provide higher display resolutions. That said, there’s nothing preventing the same miniport to be used. Installation is roughly similar to NT 3.5x, but the display settings menu can be accessed simply by right clicking on the desktop, selecting Properties, and going to the Settings tab in the Display Properties dialog. On NT 4.0 and later, there’s no need to restart when subsequently changing the display mode.
Implementation and Technical Notes
The miniport is currently limited to resolutions up to 1024×768. That is simply an arbitrary implementation limitation to keep the list of supported display modes relatively short. There is no technical reason why much higher resolutions couldn’t be used; what Windows NT would make of them is another question. It’s likely that further resolutions will be added in the future.
Performance is surprisingly good when using the software rendering implemented in FRAMEBUF.DLL. There is therefore no plan to implement an accompanying display DLL. The reason why NT displays so much faster with the custom video miniport compared to the standard VGA miniport is simple: with 16-color VGA, the display memory is organized in a very non-straightforward way and nearly every video memory access must be trapped and emulated. With the custom miniport, the display memory organization is very straightforward and the guest OS can access it directly, with no performance penalty.
The miniport driver was developed with the Open Watcom compiler (the Microsoft DDK was not used, except as a documentation source) and debugged on a set of VirtualBox VMs using WinDbg.