Discussion:
[edk2] [PATCH 0/4] Add TtyTerm terminal type
Roy Franz
2015-06-22 23:30:07 UTC
Permalink
This patchset is a followup to my previous backspace/LinuxTerm patchsets.
It adds a new terminal type "TtyTerm", that better handles
the typical Linux terminal (xterm/rxvt/gnome terminal/etc.)
These often treat backspace/delete differently than the
existing EDK2 terminal types expect, particularly in emulated
environments where the emulated serial port is connected
to a graphical terminal rather than a serial console.

This patchset includes changes to make the terminal type build time configurable
for the QEMU Aarch64 configuration. Once this patchset goes in I will submit
patches for the other emulated ARM platforms as appropriate.


Changes from LinuxTerm RFC patchset:
* Change to ttyTerm name - nothing linux specific in patchset
* remove changes to Mde module, as changes not part of UEFI specification

Laszlo Ersek (1):
Add PCD for selecting terminal type

Roy Franz (3):
Add "TtyTerm" terminal type to TerminalDxe
Treat ASCII 0x7F as backspace for TtyTerm terminals
accept [3~ as delete for TtyTerm terminals

ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++++++++++++++++++++++
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 +++++++++++++++++++++++++++++++++++++-------
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 47 ++++++++++++++++++++++++++++++++++++++++++++---
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
11 files changed, 140 insertions(+), 14 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/TtyTerm.h
--
2.1.4
Roy Franz
2015-06-22 23:30:08 UTC
Permalink
This patch adds new terminal type, TtyTerm, to TerminalDxe. This terminal
type provides a place to add support for various *nix terminals that don't
behave like standard VT terminals.

Signed-off-by: Roy Franz <***@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++++++++++++++++++++++
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 +++++++++++++++++++++++++++++++++++++-------
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 4 +++-
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
7 files changed, 73 insertions(+), 8 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/TtyTerm.h b/MdeModulePkg/Include/Guid/TtyTerm.h
new file mode 100644
index 0000000..900e5af
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/TtyTerm.h
@@ -0,0 +1,25 @@
+/** @file
+GUID definition for TtyTerm terminal type. The TtyTerm terminal aims to
+provide support for modern *nix terminals.
+
+
+Copyright (c) 2015 Linaro Ltd.
+This program and the accompanying materials are licensed and made
+available under the terms and conditions of the BSD License that
+accompanies this distribution. The full text of the license may be found
+at http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __TTYTERM_H__
+#define __TTYTERM_H__
+
+#define EFI_TTY_TERM_GUID \
+ {0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 } }
+
+extern EFI_GUID gEfiTtyTermGuid;
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 14e27a2..9132566 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -292,6 +292,9 @@
# Include/Guid/LzmaDecompress.h
gLzmaCustomDecompressGuid = { 0xEE4E5898, 0x3914, 0x4259, { 0x9D, 0x6E, 0xDC, 0x7B, 0xD7, 0x94, 0x03, 0xCF }}
gLzmaF86CustomDecompressGuid = { 0xD42AE6BD, 0x1352, 0x4bfb, { 0x90, 0x9A, 0xCA, 0x72, 0xA6, 0xEA, 0xE8, 0x89 }}
+
+ ## Include/Guid/Guid/TtyTerm.h
+ gEfiTtyTermGuid = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 }}

[Ppis]
## Include/Ppi/AtaController.h
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index 966fb79..babb097 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -33,7 +33,8 @@ EFI_GUID *gTerminalType[] = {
&gEfiPcAnsiGuid,
&gEfiVT100Guid,
&gEfiVT100PlusGuid,
- &gEfiVTUTF8Guid
+ &gEfiVTUTF8Guid,
+ &gEfiTtyTermGuid
};


@@ -152,12 +153,13 @@ TerminalDriverBindingSupported (

}
//
- // only supports PC ANSI, VT100, VT100+ and VT-UTF8 terminal types
+ // only supports PC ANSI, VT100, VT100+, VT-UTF8, and TtyTerm terminal types
//
if (!CompareGuid (&Node->Guid, &gEfiPcAnsiGuid) &&
!CompareGuid (&Node->Guid, &gEfiVT100Guid) &&
!CompareGuid (&Node->Guid, &gEfiVT100PlusGuid) &&
- !CompareGuid (&Node->Guid, &gEfiVTUTF8Guid)) {
+ !CompareGuid (&Node->Guid, &gEfiVTUTF8Guid) &&
+ !CompareGuid (&Node->Guid, &gEfiTtyTermGuid)) {

return EFI_UNSUPPORTED;
}
@@ -275,6 +277,10 @@ BuildTerminalDevpath (

TerminalType = VTUTF8TYPE;

+ } else if (CompareGuid (&Node->Guid, &gEfiTtyTermGuid)) {
+
+ TerminalType = TTYTERMTYPE;
+
} else {
return NULL;
}
@@ -708,9 +714,9 @@ TerminalDriverBindingStart (

TerminalType = PcdGet8 (PcdDefaultTerminalType);
//
- // Must be between PCANSITYPE (0) and VTUTF8TYPE (3)
+ // Must be between PCANSITYPE (0) and TTYTERMTYPE (4)
//
- ASSERT (TerminalType <= VTUTF8TYPE);
+ ASSERT (TerminalType <= TTYTERMTYPE);

CopyMem (&DefaultNode->Guid, gTerminalType[TerminalType], sizeof (EFI_GUID));
RemainingDevicePath = (EFI_DEVICE_PATH_PROTOCOL *) DefaultNode;
@@ -728,6 +734,8 @@ TerminalDriverBindingStart (
TerminalType = VT100PLUSTYPE;
} else if (CompareGuid (&Node->Guid, &gEfiVTUTF8Guid)) {
TerminalType = VTUTF8TYPE;
+ } else if (CompareGuid (&Node->Guid, &gEfiTtyTermGuid)) {
+ TerminalType = TTYTERMTYPE;
} else {
goto Error;
}
@@ -926,6 +934,24 @@ TerminalDriverBindingStart (
);

break;
+
+ case TTYTERMTYPE:
+ AddUnicodeString2 (
+ "eng",
+ gTerminalComponentName.SupportedLanguages,
+ &TerminalDevice->ControllerNameTable,
+ (CHAR16 *)L"Tty Terminal Serial Console",
+ TRUE
+ );
+ AddUnicodeString2 (
+ "en",
+ gTerminalComponentName2.SupportedLanguages,
+ &TerminalDevice->ControllerNameTable,
+ (CHAR16 *)L"Tty Terminal Serial Console",
+ FALSE
+ );
+
+ break;
}

//
@@ -1441,7 +1467,7 @@ TerminalUpdateConsoleDevVariable (
//
// Append terminal device path onto the variable.
//
- for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) {
+ for (TerminalType = PCANSITYPE; TerminalType <= TTYTERMTYPE; TerminalType++) {
SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);
NewVariable = AppendDevicePathInstance (Variable, TempDevicePath);
ASSERT (NewVariable != NULL);
@@ -1554,7 +1580,7 @@ TerminalRemoveConsoleDevVariable (
// Loop through all the terminal types that this driver supports
//
Match = FALSE;
- for (TerminalType = PCANSITYPE; TerminalType <= VTUTF8TYPE; TerminalType++) {
+ for (TerminalType = PCANSITYPE; TerminalType <= TTYTERMTYPE; TerminalType++) {

SetTerminalDevicePath (TerminalType, ParentDevicePath, &TempDevicePath);

@@ -1658,6 +1684,10 @@ SetTerminalDevicePath (
CopyGuid (&Node.Guid, &gEfiVTUTF8Guid);
break;

+ case TTYTERMTYPE:
+ CopyGuid (&Node.Guid, &gEfiTtyTermGuid);
+ break;
+
default:
return EFI_UNSUPPORTED;
}
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index d393acb..03542a4 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

#include <Guid/GlobalVariable.h>
#include <Guid/PcAnsi.h>
+#include <Guid/TtyTerm.h>
#include <Guid/StatusCodeDataTypeVariable.h>

#include <Protocol/SimpleTextOut.h>
@@ -136,6 +137,7 @@ typedef union {
#define VT100TYPE 1
#define VT100PLUSTYPE 2
#define VTUTF8TYPE 3
+#define TTYTERMTYPE 4

#define LEFTOPENBRACKET 0x5b // '['
#define ACAP 0x41
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 4a008c9..17a1244 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -454,6 +454,7 @@ TranslateRawDataToEfiKey (
case PCANSITYPE:
case VT100TYPE:
case VT100PLUSTYPE:
+ case TTYTERMTYPE:
AnsiRawDataToUnicode (TerminalDevice);
UnicodeToEfiKey (TerminalDevice);
break;
@@ -1393,7 +1394,8 @@ UnicodeToEfiKey (
if (TerminalDevice->TerminalType == PCANSITYPE ||
TerminalDevice->TerminalType == VT100TYPE ||
TerminalDevice->TerminalType == VT100PLUSTYPE ||
- TerminalDevice->TerminalType == VTUTF8TYPE) {
+ TerminalDevice->TerminalType == VTUTF8TYPE ||
+ TerminalDevice->TerminalType == TTYTERMTYPE) {
switch (UnicodeChar) {
case 'A':
Key.ScanCode = SCAN_UP;
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index affb3ae..9fa952a 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -223,6 +223,7 @@ TerminalConOutOutputString (
case PCANSITYPE:
case VT100TYPE:
case VT100PLUSTYPE:
+ case TTYTERMTYPE:

if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar)) {
//
@@ -371,6 +372,7 @@ TerminalConOutTestString (
case PCANSITYPE:
case VT100TYPE:
case VT100PLUSTYPE:
+ case TTYTERMTYPE:
Status = AnsiTestString (TerminalDevice, WString);
break;

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
index 1d86388..0780296 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
@@ -73,6 +73,7 @@
gEfiVT100Guid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
gEfiVT100PlusGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
gEfiPcAnsiGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
+ gEfiTtyTermGuid ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES ## GUID

[Protocols]
--
2.1.4
Roy Franz
2015-06-22 23:30:09 UTC
Permalink
Treat ASCII 0x7F as backspace, rather than delete, for TTY terminals. This
better matches the default Linux terminal settings that are used when connecting
to a simulated platform using xterm or a similar terminal program.

Signed-off-by: Roy Franz <***@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 17a1244..227df85 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -1561,8 +1561,14 @@ UnicodeToEfiKey (
}

if (UnicodeChar == DEL) {
- Key.ScanCode = SCAN_DELETE;
- Key.UnicodeChar = 0;
+ if (TerminalDevice->TerminalType == TTYTERMTYPE) {
+ Key.ScanCode = SCAN_NULL;
+ Key.UnicodeChar = CHAR_BACKSPACE;
+ }
+ else {
+ Key.ScanCode = SCAN_DELETE;
+ Key.UnicodeChar = 0;
+ }
} else {
Key.ScanCode = SCAN_NULL;
Key.UnicodeChar = UnicodeChar;
--
2.1.4
Roy Franz
2015-06-22 23:30:10 UTC
Permalink
Accept the VT200 escape code [3~ as backspace for TtyTerm
terminals. This is sent by many Linux terminals by default.
This is the first 3 charactar escape sequency handled,
so a new state is added to the escape sequence handling
state machine.

Signed-off-by: Roy Franz <***@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
---
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 1 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 33 +++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 03542a4..4616ab3 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -118,6 +118,7 @@ typedef struct {
#define INPUT_STATE_LEFTOPENBRACKET 0x04
#define INPUT_STATE_O 0x08
#define INPUT_STATE_2 0x10
+#define INPUT_STATE_LEFTOPENBRACKET_2 0x20

#define RESET_STATE_DEFAULT 0x00
#define RESET_STATE_ESC_R 0x01
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 227df85..7849584 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -1397,6 +1397,12 @@ UnicodeToEfiKey (
TerminalDevice->TerminalType == VTUTF8TYPE ||
TerminalDevice->TerminalType == TTYTERMTYPE) {
switch (UnicodeChar) {
+ case '3':
+ if (TerminalDevice->TerminalType == TTYTERMTYPE) {
+ TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2;
+ continue;
+ }
+ break;
case 'A':
Key.ScanCode = SCAN_UP;
break;
@@ -1527,6 +1533,33 @@ UnicodeToEfiKey (
break;


+ case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTOPENBRACKET_2:
+
+ Key.ScanCode = SCAN_NULL;
+
+ if (TerminalDevice->TerminalType == TTYTERMTYPE) {
+ switch (UnicodeChar) {
+ case '~':
+ Key.ScanCode = SCAN_DELETE;
+ break;
+ }
+ }
+
+ TerminalDevice->ResetState = RESET_STATE_DEFAULT;
+
+ if (Key.ScanCode != SCAN_NULL) {
+ Key.UnicodeChar = 0;
+ EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
+ TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+ UnicodeToEfiKeyFlushState (TerminalDevice);
+ continue;
+ }
+
+ UnicodeToEfiKeyFlushState (TerminalDevice);
+
+ break;
+
+
default:
//
// Invalid state. This should never happen.
--
2.1.4
Roy Franz
2015-06-22 23:30:11 UTC
Permalink
From: Laszlo Ersek <***@redhat.com>

Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal
type. The default remains VT100 emulation, and building with the
"-D TTY_TERMINAL" option will configure the use of the TTY terminal type.

Signed-off-by: Roy Franz <***@cavium.com>
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
4 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index c6e684f..6ba8241 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -14,6 +14,7 @@

[Defines]
DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F
+ DEFINE TTY_TERMINAL = FALSE

[LibraryClasses.common]
!if $(TARGET) == RELEASE
@@ -354,6 +355,11 @@
gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
!endif

+!if $(TTY_TERMINAL) == TRUE
+ # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94}
+!endif
+
[Components.common]
#
# Networking stack
diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
index 7bbd9ff..9833c5a 100644
--- a/ArmVirtPkg/ArmVirtPkg.dec
+++ b/ArmVirtPkg/ArmVirtPkg.dec
@@ -49,6 +49,13 @@
#
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002

+ #
+ # Binary representation of the GUID that determines the terminal type. The
+ # size must be exactly 16 bytes. The default value corresponds to
+ # EFI_VT_100_GUID.
+ #
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007
+
[PcdsDynamic, PcdsFixedAtBuild]
#
# ARM PSCI function invocations can be done either through hypervisor
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
index 499cce5..a04d603 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
@@ -34,7 +34,7 @@
typedef struct {
VENDOR_DEVICE_PATH SerialDxe;
UART_DEVICE_PATH Uart;
- VENDOR_DEFINED_DEVICE_PATH Vt100;
+ VENDOR_DEFINED_DEVICE_PATH TermType;
EFI_DEVICE_PATH_PROTOCOL End;
} PLATFORM_SERIAL_CONSOLE;
#pragma pack ()
@@ -66,14 +66,16 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
},

//
- // VENDOR_DEFINED_DEVICE_PATH Vt100
+ // VENDOR_DEFINED_DEVICE_PATH TermType
//
{
{
MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
- },
- EFI_VT_100_GUID
+ }
+ //
+ // Guid to be filled in dynamically
+ //
},

//
@@ -385,6 +387,8 @@ PlatformBdsPolicyBehavior (
//
// Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.
//
+ CopyGuid (&mSerialConsole.TermType.Guid,
+ PcdGetPtr (PcdTerminalTypeGuidBuffer));
BdsLibUpdateConsoleVariable (L"ConIn",
(EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);
BdsLibUpdateConsoleVariable (L"ConOut",
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
index d8f8926..b9fb536 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
@@ -39,6 +39,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
+ ArmVirtPkg/ArmVirtPkg.dec

[LibraryClasses]
BaseLib
@@ -61,6 +62,9 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits

+[Pcd]
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer
+
[Guids]
gEfiFileInfoGuid
gEfiFileSystemInfoGuid
--
2.1.4
Roy Franz
2015-06-22 23:33:40 UTC
Permalink
Post by Roy Franz
Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal
type. The default remains VT100 emulation, and building with the
"-D TTY_TERMINAL" option will configure the use of the TTY terminal type.
Got the wrong email on this one...
Post by Roy Franz
Contributed-under: TianoCore Contribution Agreement 1.0
---
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
4 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index c6e684f..6ba8241 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -14,6 +14,7 @@
[Defines]
DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F
+ DEFINE TTY_TERMINAL = FALSE
[LibraryClasses.common]
!if $(TARGET) == RELEASE
@@ -354,6 +355,11 @@
gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
!endif
+!if $(TTY_TERMINAL) == TRUE
+ # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94}
+!endif
+
[Components.common]
#
# Networking stack
diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
index 7bbd9ff..9833c5a 100644
--- a/ArmVirtPkg/ArmVirtPkg.dec
+++ b/ArmVirtPkg/ArmVirtPkg.dec
@@ -49,6 +49,13 @@
#
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002
+ #
+ # Binary representation of the GUID that determines the terminal type. The
+ # size must be exactly 16 bytes. The default value corresponds to
+ # EFI_VT_100_GUID.
+ #
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007
+
[PcdsDynamic, PcdsFixedAtBuild]
#
# ARM PSCI function invocations can be done either through hypervisor
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
index 499cce5..a04d603 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
@@ -34,7 +34,7 @@
typedef struct {
VENDOR_DEVICE_PATH SerialDxe;
UART_DEVICE_PATH Uart;
- VENDOR_DEFINED_DEVICE_PATH Vt100;
+ VENDOR_DEFINED_DEVICE_PATH TermType;
EFI_DEVICE_PATH_PROTOCOL End;
} PLATFORM_SERIAL_CONSOLE;
#pragma pack ()
@@ -66,14 +66,16 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
},
//
- // VENDOR_DEFINED_DEVICE_PATH Vt100
+ // VENDOR_DEFINED_DEVICE_PATH TermType
//
{
{
MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
- },
- EFI_VT_100_GUID
+ }
+ //
+ // Guid to be filled in dynamically
+ //
},
//
@@ -385,6 +387,8 @@ PlatformBdsPolicyBehavior (
//
// Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.
//
+ CopyGuid (&mSerialConsole.TermType.Guid,
+ PcdGetPtr (PcdTerminalTypeGuidBuffer));
BdsLibUpdateConsoleVariable (L"ConIn",
(EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);
BdsLibUpdateConsoleVariable (L"ConOut",
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
index d8f8926..b9fb536 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
@@ -39,6 +39,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
+ ArmVirtPkg/ArmVirtPkg.dec
[LibraryClasses]
BaseLib
@@ -61,6 +62,9 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+[Pcd]
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer
+
[Guids]
gEfiFileInfoGuid
gEfiFileSystemInfoGuid
--
2.1.4
Laszlo Ersek
2015-06-23 07:47:09 UTC
Permalink
(Sorry I could not reply to your email about the authorship tags last
night, I was too tired and went offline pretty early.)
Post by Roy Franz
Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal
type. The default remains VT100 emulation, and building with the
"-D TTY_TERMINAL" option will configure the use of the TTY terminal type.
Contributed-under: TianoCore Contribution Agreement 1.0
I propose:
(a) keep the From: at the top (ie. git commit --author=lersek...),
(b) the tags should look like, in this order:

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <***@redhat.com>
[Roy Franz: add TtyTerminal GUID, rename LINUX_TERMINAL to TTY_TERMINAL]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Roy Franz <***@linaro.org>

(Updated your email address from your followup message.)

Then Ard should review the patch (because you and I can't, due to our
authorships).
Post by Roy Franz
---
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
4 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index c6e684f..6ba8241 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -14,6 +14,7 @@
[Defines]
DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F
+ DEFINE TTY_TERMINAL = FALSE
[LibraryClasses.common]
!if $(TARGET) == RELEASE
@@ -354,6 +355,11 @@
gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
!endif
+!if $(TTY_TERMINAL) == TRUE
+ # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID
This depends on Feng's review, but I think EFI_TTY_TERM_GUID might not
be the best name, as long as it is not standard. (I guess the EFI_
prefix should simply be dropped.) Same for the "Efi" substring in
"gEfiTtyTermGuid", elsewhere. Again, depends on what Feng says.

Thanks!
Laszlo
Post by Roy Franz
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94}
+!endif
+
[Components.common]
#
# Networking stack
diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
index 7bbd9ff..9833c5a 100644
--- a/ArmVirtPkg/ArmVirtPkg.dec
+++ b/ArmVirtPkg/ArmVirtPkg.dec
@@ -49,6 +49,13 @@
#
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002
+ #
+ # Binary representation of the GUID that determines the terminal type. The
+ # size must be exactly 16 bytes. The default value corresponds to
+ # EFI_VT_100_GUID.
+ #
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007
+
[PcdsDynamic, PcdsFixedAtBuild]
#
# ARM PSCI function invocations can be done either through hypervisor
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
index 499cce5..a04d603 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
@@ -34,7 +34,7 @@
typedef struct {
VENDOR_DEVICE_PATH SerialDxe;
UART_DEVICE_PATH Uart;
- VENDOR_DEFINED_DEVICE_PATH Vt100;
+ VENDOR_DEFINED_DEVICE_PATH TermType;
EFI_DEVICE_PATH_PROTOCOL End;
} PLATFORM_SERIAL_CONSOLE;
#pragma pack ()
@@ -66,14 +66,16 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
},
//
- // VENDOR_DEFINED_DEVICE_PATH Vt100
+ // VENDOR_DEFINED_DEVICE_PATH TermType
//
{
{
MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
- },
- EFI_VT_100_GUID
+ }
+ //
+ // Guid to be filled in dynamically
+ //
},
//
@@ -385,6 +387,8 @@ PlatformBdsPolicyBehavior (
//
// Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.
//
+ CopyGuid (&mSerialConsole.TermType.Guid,
+ PcdGetPtr (PcdTerminalTypeGuidBuffer));
BdsLibUpdateConsoleVariable (L"ConIn",
(EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);
BdsLibUpdateConsoleVariable (L"ConOut",
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
index d8f8926..b9fb536 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
@@ -39,6 +39,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
+ ArmVirtPkg/ArmVirtPkg.dec
[LibraryClasses]
BaseLib
@@ -61,6 +62,9 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+[Pcd]
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer
+
[Guids]
gEfiFileInfoGuid
gEfiFileSystemInfoGuid
Roy Franz
2015-06-23 17:54:13 UTC
Permalink
Post by Laszlo Ersek
(Sorry I could not reply to your email about the authorship tags last
night, I was too tired and went offline pretty early.)
Post by Roy Franz
Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal
type. The default remains VT100 emulation, and building with the
"-D TTY_TERMINAL" option will configure the use of the TTY terminal type.
Contributed-under: TianoCore Contribution Agreement 1.0
(a) keep the From: at the top (ie. git commit --author=lersek...),
Contributed-under: TianoCore Contribution Agreement 1.0
[Roy Franz: add TtyTerminal GUID, rename LINUX_TERMINAL to TTY_TERMINAL]
Contributed-under: TianoCore Contribution Agreement 1.0
(Updated your email address from your followup message.)
Then Ard should review the patch (because you and I can't, due to our
authorships).
Thanks Laszlo - I'll fix this up in the next version.
Post by Laszlo Ersek
Post by Roy Franz
---
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
4 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index c6e684f..6ba8241 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -14,6 +14,7 @@
[Defines]
DEFINE DEBUG_PRINT_ERROR_LEVEL = 0x8000004F
+ DEFINE TTY_TERMINAL = FALSE
[LibraryClasses.common]
!if $(TARGET) == RELEASE
@@ -354,6 +355,11 @@
gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04
!endif
+!if $(TTY_TERMINAL) == TRUE
+ # Set terminal type to TtyTerm, the value encoded is EFI_TTY_TERM_GUID
This depends on Feng's review, but I think EFI_TTY_TERM_GUID might not
be the best name, as long as it is not standard. (I guess the EFI_
prefix should simply be dropped.) Same for the "Efi" substring in
"gEfiTtyTermGuid", elsewhere. Again, depends on what Feng says.
Yup, I was matching how the other terminals were defined, but that's likely
wrong since they are part of the spec, and the TtyTerm isn't.
Post by Laszlo Ersek
Thanks!
Laszlo
Post by Roy Franz
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x80, 0x6d, 0x91, 0x7d, 0xb1, 0x5b, 0x8c, 0x45, 0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94}
+!endif
+
[Components.common]
#
# Networking stack
diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
index 7bbd9ff..9833c5a 100644
--- a/ArmVirtPkg/ArmVirtPkg.dec
+++ b/ArmVirtPkg/ArmVirtPkg.dec
@@ -49,6 +49,13 @@
#
gArmVirtTokenSpaceGuid.PcdDeviceTreeAllocationPadding|256|UINT32|0x00000002
+ #
+ # Binary representation of the GUID that determines the terminal type. The
+ # size must be exactly 16 bytes. The default value corresponds to
+ # EFI_VT_100_GUID.
+ #
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF, 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|VOID*|0x00000007
+
[PcdsDynamic, PcdsFixedAtBuild]
#
# ARM PSCI function invocations can be done either through hypervisor
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
index 499cce5..a04d603 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c
@@ -34,7 +34,7 @@
typedef struct {
VENDOR_DEVICE_PATH SerialDxe;
UART_DEVICE_PATH Uart;
- VENDOR_DEFINED_DEVICE_PATH Vt100;
+ VENDOR_DEFINED_DEVICE_PATH TermType;
EFI_DEVICE_PATH_PROTOCOL End;
} PLATFORM_SERIAL_CONSOLE;
#pragma pack ()
@@ -66,14 +66,16 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
},
//
- // VENDOR_DEFINED_DEVICE_PATH Vt100
+ // VENDOR_DEFINED_DEVICE_PATH TermType
//
{
{
MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
- },
- EFI_VT_100_GUID
+ }
+ //
+ // Guid to be filled in dynamically
+ //
},
//
@@ -385,6 +387,8 @@ PlatformBdsPolicyBehavior (
//
// Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.
//
+ CopyGuid (&mSerialConsole.TermType.Guid,
+ PcdGetPtr (PcdTerminalTypeGuidBuffer));
BdsLibUpdateConsoleVariable (L"ConIn",
(EFI_DEVICE_PATH_PROTOCOL *)&mSerialConsole, NULL);
BdsLibUpdateConsoleVariable (L"ConOut",
diff --git a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
index d8f8926..b9fb536 100644
--- a/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
+++ b/ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
@@ -39,6 +39,7 @@
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
+ ArmVirtPkg/ArmVirtPkg.dec
[LibraryClasses]
BaseLib
@@ -61,6 +62,9 @@
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits
+[Pcd]
+ gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer
+
[Guids]
gEfiFileInfoGuid
gEfiFileSystemInfoGuid
Tian, Feng
2015-06-23 06:42:58 UTC
Permalink
Roy

Thanks for your contribution, We will review it soon.

Thanks
Feng

-----Original Message-----
From: Roy Franz [mailto:***@linaro.org]
Sent: Tuesday, June 23, 2015 07:30
To: edk2-***@lists.sourceforge.net; Tian, Feng; ***@redhat.com; ***@linaro.org
Cc: Roy Franz
Subject: [PATCH 0/4] Add TtyTerm terminal type

This patchset is a followup to my previous backspace/LinuxTerm patchsets.
It adds a new terminal type "TtyTerm", that better handles the typical Linux terminal (xterm/rxvt/gnome terminal/etc.) These often treat backspace/delete differently than the existing EDK2 terminal types expect, particularly in emulated environments where the emulated serial port is connected to a graphical terminal rather than a serial console.

This patchset includes changes to make the terminal type build time configurable for the QEMU Aarch64 configuration. Once this patchset goes in I will submit patches for the other emulated ARM platforms as appropriate.


Changes from LinuxTerm RFC patchset:
* Change to ttyTerm name - nothing linux specific in patchset
* remove changes to Mde module, as changes not part of UEFI specification

Laszlo Ersek (1):
Add PCD for selecting terminal type

Roy Franz (3):
Add "TtyTerm" terminal type to TerminalDxe
Treat ASCII 0x7F as backspace for TtyTerm terminals
accept [3~ as delete for TtyTerm terminals

ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++++++++++++++++++++++
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 +++++++++++++++++++++++++++++++++++++-------
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 47 ++++++++++++++++++++++++++++++++++++++++++++---
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
11 files changed, 140 insertions(+), 14 deletions(-) create mode 100644 MdeModulePkg/Include/Guid/TtyTerm.h

--
2.1.4
Laszlo Ersek
2015-06-23 07:55:28 UTC
Permalink
Post by Roy Franz
This patchset is a followup to my previous backspace/LinuxTerm patchsets.
It adds a new terminal type "TtyTerm", that better handles
the typical Linux terminal (xterm/rxvt/gnome terminal/etc.)
These often treat backspace/delete differently than the
existing EDK2 terminal types expect, particularly in emulated
environments where the emulated serial port is connected
to a graphical terminal rather than a serial console.
This patchset includes changes to make the terminal type build time configurable
for the QEMU Aarch64 configuration. Once this patchset goes in I will submit
patches for the other emulated ARM platforms as appropriate.
* Change to ttyTerm name - nothing linux specific in patchset
* remove changes to Mde module, as changes not part of UEFI specification
Add PCD for selecting terminal type
Add "TtyTerm" terminal type to TerminalDxe
Treat ASCII 0x7F as backspace for TtyTerm terminals
accept [3~ as delete for TtyTerm terminals
(I'm at fault partly because I sent you a raw diff last time, without
any kind of subject / commit message. Anyway,)

please prefix subject lines with the respective package names, and (if
you've got enough room to squeeze that too in 74 characters) the library
/ driver name is helpful as well. Something like:

MdeModulePkg: TerminalDxe: add TtyTerm terminal type
MdeModulePkg: TerminalDxe: treat ASCII 0x7F as backspace for TtyTerm
MdeModulePkg: TerminalDxe: accept (0x5B 0x33 0x7E) as delete for TtyTerm
ArmVirtPkg: PlatformIntelBdsLib: add PCD for selecting terminal type

(You can replace the first ": " string with "/" if you prefer that.)

Regarding the "[3~" --> "(0x5B 0x33 0x7E)" change in the third patch's
subject: I'm a bit worried about the opening bracket *outside* of the
bag-of-tags subject prefix (ie. outside of "[PATCH 3/4]"). I'm concerned
some patch-handling tools might choke on that bracket, hence the idea to
describe the ASCII in hex.

Thanks!
Laszlo
Post by Roy Franz
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++++++
ArmVirtPkg/ArmVirtPkg.dec | 7 +++++++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++++++++----
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 ++++
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++++++++++++++++++++++
MdeModulePkg/MdeModulePkg.dec | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 +++++++++++++++++++++++++++++++++++++-------
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 3 +++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 47 ++++++++++++++++++++++++++++++++++++++++++++---
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 ++
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
11 files changed, 140 insertions(+), 14 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/TtyTerm.h
Loading...