Firmware Encoding Index UEFI DEV Mailing List Search This Site





Subject:
Re: [edk2] How to switch from GUI to text mode (console)
From:
Andrew Fish
Date:
4/13/2012 1:56 AM
To:
Eric Kler , edk2-devel@lists.sourceforge.net

Eric,

EFI_CONSOLE_CONTROL_PROTOCOL was part of the EDK implementation and the ConSpliter used this to stop sending SimpleTextOut to the graphics screen, or to send the pending SimpleTextOut back to the graphics screen based on the mode. 

In the edk2 there is just the graphics screen. When you do a ConOut->OutputString (ConOut, "Hello\n\r") the GraphicsConsoleDxe driver should just convert this to a Graphics Output Protocol Blt() to the graphics screen. Given the the GraphicsConsoleDxe has a fixed font size it centers the SimpleTextOut output area in the center of the screen and does not touch the area outside of the text box. So for example if you also have a serial terminal and a graphics screen you could end up with an 80x25 console that does not fill the graphics screen. So if there is junk on the screen you would need to do a Graphics Output Protocol Blt to clear the entire screen. 

Thus the edk2 model is the code that is running owns the screen. If you are running on a system that has a stock edk2 ConSpliter the only thing that comes to mind is the GUI code is still running an overwriting your text. If your system does not have a stock edk2 ConSpilter you may want to see if the EFI_CONSOLE_CONTROL_PROTOCOL exists  and use that. 


https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/


On Apr 12, 2012, at 3:01 AM, Eric Kler wrote:

Hello,

Is there any way to switch from EFI GUI oriented boot manager to text mode (console)? I have tried using ConOut->ClearScreen (ConOut); function but it is not really working. The problem is I can't really see any of my output messages while in the GUI mode. When I'm running my application from the shell itself everything is ok (Print/OutputText works) but obviously I want to skip running&using the shell.

As far as I know in some previous EFI projects some applications were using EFI_CONSOLE_CONTROL_PROTOCOL to achieve that but it seems it is not longer available in EDK2 (at least I have no idea how to use it).


So this is a big hack. But you could try adding EdkCompatibilityPkg/EdkCompatibilityPkg.dec to the [Packages]  section of your edk2 INF file. 

Then you can add this code to your application. 
#include <../../Foundation/Protocol/ConsoleControl/ConsoleControl.h>

EFI_GUID gEfiConsoleControlProtocolGuid = EFI_CONSOLE_CONTROL_PROTOCOL_GUID;


Thanks for help.

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel



------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel