PRB: Linear Addr Mode Display Driver & MS-DOS Virtual Machines

Last reviewed: April 12, 1995
Article ID: Q92648
The information in this article applies to:
  • Microsoft Windows Device Driver Kit (DDK) for Windows version 3.1

Linear address mode display drivers must save the extended portions of the CPU registers. Some enhanced mode grabbers assume that the display driver does save these register portions. Windowed MS-DOS sessions can become filled with 'garbage' if the display driver does not save the extended CPU register portions.

SYMPTOMS

When an MS-DOS session is opened to full screen and then converted to a windowed shell, the client area is filled with text-like 'garbage'. If a DIR or CLS command is issued, the windowed MS-DOS session is filled with the correct information at the point where the command was entered. Any scrolling thereafter displays the correct information.

If the windowed screen is enlarged it will also fill up with the similar type of 'garbage' and will correct itself when scrolled or cleared.

CAUSE

The cause of this type of problem is a 'trashing' of the high part of some register(s) by the display driver. When the display grabber receives the execution focus with corrupted registers, the result is screen garbage.

RESOLUTION

Modify your display driver so that it saves the extended portions of registers before using them and restores them after your through. Do not assume that the extended portions of the CPU registers are free to trash.

MORE INFORMATION

While it could be argued that it is not required to save the high portions of the CPU registers, the fact is that there are grabbers out there that assume otherwise. At a minimum, you need to make sure to save and restore processor registers ESI,EDI in BitBlt(). It is likely that your driver code is saving and restoring SI,DI but you are using ESI,EDI, which means the high part of ESI,EDI is not being preserved correctly. There may also be a need to save the other extended registers as well.

Note that this problem does not occur when a 'segmented' driver is used. The segmented driver accesses the video memory at the standard locations of A0000-BFFFF. This problem does not occur with full screen only MS-DOS sessions.


Additional reference words: 3.10 DDK display driver
KBCategory: kbprg kbprb
KBSubcategory: D2DispQuest


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 12, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.