CMD Prompt Can be Full Screen Again in Windows 7?! – An Explanation of Why Windows 7 Doesn’t Support CMD Prompt Full-Screen Mode and an Issue Analysis.
Title: CMD Prompt Can be Full Screen Again in Windows 7?! – An Explanation of Why Windows 7 Doesn’t Support CMD Prompt Full-Screen Mode and an Issue Analysis.
Author: Colin.Xu@gmail.com
Date: 2011/02/17
Recently my colleague found an interesting phenomenon in Windows 7, sometimes the cmd prompt (dos command window) can be switched to full-screen mode by pressing ALT+Enter. You can easily reproduce this issue by simply disable and re-enable you display adapter. After restarting, all backs to normal: a message box will pop up and notify you that the full-screen mode is not supported.
Many users may already know that ALT+Enter is a commonly used hotkey to switch application between window mode and full-screen mode. For the cmd prompt, the hotkey should work as expected on prior windows OS before windows XP. But for Windows Vista and Windows 7, cmd shouldn’t be switched to full-screen mode, this is by design. If you know some workaround to switch cmd to full-screen, please be patient to read the following analysis first. Then I’ll tell you some known “workaround”.
After the display driver is installed and enabled properly, OS will pass all the desktop resolution changes to driver, then driver will manipulate the graphics adapter to output the desired video signal to monitor. But when display driver is disabled or in dos full-screen mode, the resolution change is not handled by driver anymore. The VGA driver of OS (VGA.SYS) will pass all mode change request to VBIOS via interrupt call (INT 10), then VBIOS will program the graphics adapter. In XDDM (Windows XP Display Driver Model, adopted in Windows 2000 and Windows XP), INT 10 communications between OS and Video BIOS is permitted. But from WDDM (Windows Display Driver Model, adopted in Windows Vista and Windows 7), INT 10 communication is not allowed because of potential unstable problem. Microsoft suggests using ACPI method. For more detailed explanation, please check
http://www.microsoft.com/whdc/system/platform/firmware/wddm_bios.mspx.
So why cmd can be switched to full-screen after end-user disable and re-enable the display driver? First, we should know how Windows Vista and Windows 7 block the switching, how it works.
1. When user start a cmd prompt, C/S Runtime SubSystem (csrss.exe) will create a Console Window Host process (conhost.exe).
2. During the initialization of conhost.exe, it will initialize some full-screen parameters by calling conhost!InitializeFullScreen() function.
3. Conhost.exe call into kernel space, via win32k!DrvEnumDisplaySettings() function, to get available dos full-screen display device.
In display driver enabled mode, the device should be empty, because in this mode OS doesn’t support full-screen dos.
In display driver disabled mode, the device name is “Video3″, it is the “VGA safe device”, which means in this mode VGA.SYS will handle the resolution change with VBIOS.
If currently it is the VGA driver, (display driver disabled mode), it will “OR” the flag (0×10000000) to conhost!gConsoleInformation.Flags, at the offset 0x10c of structure _CONSOLE_INFORMATION, to indicate that the cmd prompt can be switched to full-screen mode.
If currently there is no VGA driver, (display driver enabled mode), it will “OR” the flag (0×00000000), to indicate that the cmd prompt cannot be switched to full-screen dos.
4. Then user press ALT+Enter hotkey. The conhost!HandleSysKeyEvent thread will catch the key pressing message, and first it will check the conhost!gConsoleInformation, if it supports VGA mode (VBIOS will handle the resolution change).
If it doesn’t support (conhost!gConsoleInformation.Flags doesn’t have 0×10000000 bit), then it will pop up the warning message box.
If it supports (conhost!gConsoleInformation.Flags has 0×10000000 bit), then will switch to full-screen dos (by calling conhost!ConvertToFullScreen()) or back to window mode (conhost!ConvertToWindowed).
In OS kernel, there is a global variable, win32k!gFullscreenGraphicsDevice, to save current dos full-screen display device.
In normal case, display driver enabled mode, win32k!gFullscreenGraphicsDevice is empty. So the switching to full-screen of cmd prompt can be blocked.
After a Stop/Start display device happens, win32k!gFullscreenGraphicsDevice is not cleared, so conhost.exe will think there exists a dos full-screen display device, then the switching to full-screen dos cannot be blocked anymore, but executed.
During Windows boot up, after display driver is enabled, OS will call win32k!DrvUpdateVgaDevice() function to clear win32k!gFullscreenGraphicsDevice.
When disable the display driver, OS will also call this function to update win32k!gFullscreenGraphicsDevice to VGA safe device.
But when enable the display driver again without restarting, win32k!gFullscreenGraphicsDevice is not cleared, it still keeps the previous data, although win32k!DrvUpdateVgaDevice() is also called.
This is why this interesting issue happens.
From the above analysis, such behavior looks like an OS bug. Although I’ve posted the information on MSDN forum, I have not got any definite waiver or KB yet.
All the above analysis is based on reverse engineering by taking depth into ASM, and for the researching purpose only.
Finally, I’ll talk about some know “workaround” to make cmd prompt “full-screen”.
1. Of course, the issue described in this article is a possible way. But since INT 10 communication has some potential unstable problem, you may choose it on your own risk.
2. Install “Windows XP Mode” on Windows 7. This is actually a virtual machine. Since this is officially supported by Microsoft, it will be the best solution.
3. Change the font of cmd prompt and maximize the window. This is a pretty tricky way, isn’t it?
4. Install XDMM driver on Windows 7. I read this method in mydigitallife.info forum. To be honest, I don’t think this is a good solution. WDDM driver should have the best compatibility with Windows Vista and Windows 7. XDDM and WDDM have totally different architecture, and with no doubt, abusing the wrong model will crash the system easily.
5. Disable display driver. Just for running dos in full-screen? Why not install a pure virtual machine or run DosBox?
Hope this article may help you.
Note that Windows XP x64 Edition also doesn’t allow full screen DOS prompt.
It is really bad that in windows vista/7 could not work in fullscreen DOS videomode.
I even tried to disable my GF GTX 470 in devices list, and press alt + enter after that, but nothing happens.
After that I enabled my videocard again and discovered, that during driver enable screen goes to DOS mode and cursor blinks on black screen about 2 secs, and the next videocard switches to usual graphics videomode with normal high resolution.
Can anybody explain why I can not switch fullscreen DOS even with disabled driver?
(Windows 7 x64 Ultimate, NVIDIA Driver package 285.62)
To be brief, Microsoft doesn’t allow user to switch to full-screen DOS in Vista/Win 7. Check KB here: http://support.microsoft.com/kb/926657
Why do you need full-screen DOS?
Because I need
Don’t ask “why”!!!!!!!!!
Now I have one question: why I can not switch fullscreen DOS even with disabled Nvidia driver and also in safe mode?
In properties of cmd.exe shortcut – fullscreen mode option is hidden!!!!!!!!