[edk2-devel] VT100 terminal for UEFI shell

Andrew Fish via groups.io afish=apple.com at groups.io
Thu Sep 7 17:40:13 UTC 2023



> On Sep 7, 2023, at 8:00 AM, Marcin Juszkiewicz <marcin.juszkiewicz at linaro.org> wrote:
> 
> Is there a way to have VT100 (or any other black/white, non-ANSI) terminal for UEFI Shell?
> 
> I do many runs of QEMU/sbsa-ref with logging and all those ANSI colour codes only make problems.
> 

These are the supported consoles [1]

EFI_GUID  *mTerminalType[] = {
  &gEfiPcAnsiGuid,
  &gEfiVT100Guid,
  &gEfiVT100PlusGuid,
  &gEfiVTUTF8Guid,
  &gEfiTtyTermGuid,
  &gEdkiiLinuxTermGuid,
  &gEdkiiXtermR6Guid,
  &gEdkiiVT400Guid,
  &gEdkiiSCOTermGuid
};

CHAR16  *mSerialConsoleNames[] = {
  L"PC-ANSI Serial Console",
  L"VT-100 Serial Console",
  L"VT-100+ Serial Console",
  L"VT-UTF8 Serial Console",
  L"Tty Terminal Serial Console",
  L"Linux Terminal Serial Console",
  L"Xterm R6 Serial Console",
  L"VT-400 Serial Console",
  L"SCO Terminal Serial Console"
};

I think the OVMF default is coming from here [2]
VENDOR_DEVICE_PATH    gTerminalTypeDeviceNode    = gVtUtf8Terminal;

If you look up gVtUtf8Terminal you see [3]
#define gVtUtf8Terminal \
  { \
    { \
      MESSAGING_DEVICE_PATH, \
      MSG_VENDOR_DP, \
      { \
        (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \
        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \
      } \
    }, \
    DEVICE_PATH_MESSAGING_VT_UTF8 \
  }

Thus we get to the TL;DR part… The console NVRAM variables that point to the UART has a MESSAGING_DEVICE_PATH MSG_VENDOR_DP node after the UART definition that has a UUID (EFI_GUID) that defines the type of terminal emulation to use. 

The definition of the ConIn and ConOut variables is here [4]

[1] https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c#L24
[2] https://github.com/tianocore/edk2/blob/master/OvmfPkg/Library/PlatformBootManagerLib/PlatformData.c#L50
[3] https://github.com/tianocore/edk2/blob/master/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.h#L129
[4] https://uefi.org/specs/UEFI/2.10/03_Boot_Manager.html#globally-defined-variables

Thanks,

Andrew Fish

> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108407): https://edk2.groups.io/g/devel/message/108407
Mute This Topic: https://groups.io/mt/101216135/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20230907/3249a42f/attachment-0001.htm>


More information about the edk2-devel-archive mailing list