public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] VT100 terminal for UEFI shell
@ 2023-09-07 15:00 Marcin Juszkiewicz
  2023-09-07 17:40 ` Andrew Fish via groups.io
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Juszkiewicz @ 2023-09-07 15:00 UTC (permalink / raw)
  To: devel

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108398): https://edk2.groups.io/g/devel/message/108398
Mute This Topic: https://groups.io/mt/101216135/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] VT100 terminal for UEFI shell
  2023-09-07 15:00 [edk2-devel] VT100 terminal for UEFI shell Marcin Juszkiewicz
@ 2023-09-07 17:40 ` Andrew Fish via groups.io
  2023-09-07 19:11   ` Marcin Juszkiewicz
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Fish via groups.io @ 2023-09-07 17:40 UTC (permalink / raw)
  To: devel, marcin.juszkiewicz

[-- Attachment #1: Type: text/plain, Size: 2509 bytes --]



> On Sep 7, 2023, at 8:00 AM, Marcin Juszkiewicz <marcin.juszkiewicz@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 4663 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] VT100 terminal for UEFI shell
  2023-09-07 17:40 ` Andrew Fish via groups.io
@ 2023-09-07 19:11   ` Marcin Juszkiewicz
  2023-09-07 20:10     ` Andrew Fish via groups.io
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Juszkiewicz @ 2023-09-07 19:11 UTC (permalink / raw)
  To: Andrew (EFI) Fish, devel

W dniu 7.09.2023 o 19:40, Andrew (EFI) Fish pisze:
>> On Sep 7, 2023, at 8:00 AM, Marcin Juszkiewicz 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.


> 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]

Feels like adding alias into ~/.bashrc is easier solution:

alias strip_ansi=" sed -e 's/\x1b\[[0-9;]*m//g' "

EDK2 code feels like ancient Perl to me too often. Someone wrote it, 
everyone uses it, hard to find someone who know why it is that way.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108414): https://edk2.groups.io/g/devel/message/108414
Mute This Topic: https://groups.io/mt/101216135/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] VT100 terminal for UEFI shell
  2023-09-07 19:11   ` Marcin Juszkiewicz
@ 2023-09-07 20:10     ` Andrew Fish via groups.io
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Fish via groups.io @ 2023-09-07 20:10 UTC (permalink / raw)
  To: edk2-devel-groups-io, Marcin Juszkiewicz



> On Sep 7, 2023, at 12:11 PM, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote:
> 
> W dniu 7.09.2023 o 19:40, Andrew (EFI) Fish pisze:
>>> On Sep 7, 2023, at 8:00 AM, Marcin Juszkiewicz 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.
> 
> 
>> 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]
> 
> Feels like adding alias into ~/.bashrc is easier solution:
> 
> alias strip_ansi=" sed -e 's/\x1b\[[0-9;]*m//g' "
> 

Well like everything  the terminal default is optimized for the personal preference of who ever did OVMF port. 

> EDK2 code feels like ancient Perl to me too often. Someone wrote it, everyone uses it, hard to find someone who know why it is that way.
> 
> 

Feel free to ask I’ll probably be 24 years into at some point soon or maybe already I kind of forgot when I started.  I was around for most of the big picture stuff so that is one of the reasons I answer these general questions on the list.

Thanks,

Andrew Fish

> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108416): https://edk2.groups.io/g/devel/message/108416
Mute This Topic: https://groups.io/mt/101216135/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-07 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07 15:00 [edk2-devel] VT100 terminal for UEFI shell Marcin Juszkiewicz
2023-09-07 17:40 ` Andrew Fish via groups.io
2023-09-07 19:11   ` Marcin Juszkiewicz
2023-09-07 20:10     ` Andrew Fish via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox