public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types
@ 2019-09-12  1:02 Gao, Zhichao
  2019-09-12  1:02 ` [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console Gao, Zhichao
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-12  1:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186

Putty is a very popular terminal tool in windows. So add the whole support
terminal keyboard type for it. The new introduced type is Linux, XtermR6,
VT400 and SCO. And enhance the support for VT100+.
This patch set only add the support of function key. Refer to the link:
https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-of-by: Zhichao Gao <zhichao.gao@intel.com>

Zhichao Gao (3):
  MdeModulePkg: Entend the support keyboard type of Terminal console
  MdeModulePkg/TerminalDxe: Extend the terminal console support types
  MdeModulePkg/BM_UI: Add the new terminal types to related menu

 .../Include/Guid/TerminalConExtendedType.h    |  25 ++
 .../BootMaintenanceManager.h                  |  13 +-
 .../BootMaintenanceManagerStrings.uni         |  10 +-
 .../ConsoleOption.c                           |  35 +--
 .../BootMaintenanceManagerUiLib/Data.c        |  16 +-
 MdeModulePkg/MdeModulePkg.dec                 |   6 +
 .../Universal/Console/TerminalDxe/Terminal.c  |  17 +-
 .../Universal/Console/TerminalDxe/Terminal.h  |  37 ++-
 .../Console/TerminalDxe/TerminalConIn.c       | 281 ++++++++++++++++--
 .../Console/TerminalDxe/TerminalConOut.c      |   4 +
 .../Console/TerminalDxe/TerminalDxe.inf       |   6 +-
 11 files changed, 390 insertions(+), 60 deletions(-)
 create mode 100644 MdeModulePkg/Include/Guid/TerminalConExtendedType.h

-- 
2.21.0.windows.1


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

* [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  1:02 [PATCH 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types Gao, Zhichao
@ 2019-09-12  1:02 ` Gao, Zhichao
  2019-09-12  2:42   ` Wu, Hao A
  2019-09-12  1:02 ` [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types Gao, Zhichao
  2019-09-12  1:02 ` [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Gao, Zhichao
  2 siblings, 1 reply; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-12  1:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186

A common terminal console software Putty support various types of
keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
VT100+ and SCO. Refer to the link:
https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../Include/Guid/TerminalConExtendedType.h    | 25 +++++++++++++++++++
 MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
 2 files changed, 31 insertions(+)
 create mode 100644 MdeModulePkg/Include/Guid/TerminalConExtendedType.h

diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
new file mode 100644
index 0000000000..18667413e8
--- /dev/null
+++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
@@ -0,0 +1,25 @@
+/** @file
+  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
+
+
+  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__
+#define __TERMINAL_CON_EXTENDED_TYPE_H__
+
+#define EDKII_LINUX_MODE_GUID   \
+    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
+
+#define EDKII_XTERM_R6_GUID     \
+    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
+
+#define EDKII_VT400_GUID        \
+    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
+
+#define EDKII_SCO_GUID          \
+    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
+
+#endif
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 17beb45235..7528d52fcb 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -343,6 +343,12 @@
   ## Include/Guid/TtyTerm.h
   gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
 
+  ## Include/Guid/TerminalConExtendedType.h
+  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
+  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
+  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
+  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
+
   ## Include/Guid/HiiBootMaintenanceFormset.h
   gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
 
-- 
2.21.0.windows.1


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

* [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types
  2019-09-12  1:02 [PATCH 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types Gao, Zhichao
  2019-09-12  1:02 ` [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console Gao, Zhichao
@ 2019-09-12  1:02 ` Gao, Zhichao
  2019-09-12  2:44   ` Wu, Hao A
  2019-09-12  1:02 ` [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Gao, Zhichao
  2 siblings, 1 reply; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-12  1:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186

Extend the support types of terminal console driver. New added types
are Linux, XtermR6, VT400 and SCO.

Refer to
https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys

Add the missing VT100+ function keys map.

Add F1-F12 function keys map for Linux, XtermR6, VT400 and SCO.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../Universal/Console/TerminalDxe/Terminal.c  |  17 +-
 .../Universal/Console/TerminalDxe/Terminal.h  |  37 ++-
 .../Console/TerminalDxe/TerminalConIn.c       | 281 ++++++++++++++++--
 .../Console/TerminalDxe/TerminalConOut.c      |   4 +
 .../Console/TerminalDxe/TerminalDxe.inf       |   6 +-
 5 files changed, 319 insertions(+), 26 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
index c76b2c5100..526067d023 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
@@ -2,7 +2,7 @@
   Produces Simple Text Input Protocol, Simple Text Input Extended Protocol and
   Simple Text Output Protocol upon Serial IO Protocol.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -28,7 +28,11 @@ EFI_GUID  *mTerminalType[] = {
   &gEfiVT100Guid,
   &gEfiVT100PlusGuid,
   &gEfiVTUTF8Guid,
-  &gEfiTtyTermGuid
+  &gEfiTtyTermGuid,
+  &gEdkiiLinuxModeGuid,
+  &gEdkiiXtermR6Guid,
+  &gEdkiiVT400Guid,
+  &gEdkiiSCOGuid
 };
 
 
@@ -37,7 +41,11 @@ CHAR16 *mSerialConsoleNames[] = {
   L"VT-100 Serial Console",
   L"VT-100+ Serial Console",
   L"VT-UTF8 Serial Console",
-  L"Tty Terminal Serial Console"
+  L"Tty Terminal Serial Console",
+  L"Linux Mode Terminal Serial Console",
+  L"Xterm R6 Terminal Serial Console",
+  L"VT400 Terminal Serial Console",
+  L"SCO Terminal Serial Console"
 };
 
 TERMINAL_DEV  mTerminalDevTemplate = {
@@ -187,7 +195,8 @@ TerminalDriverBindingSupported (
 
       }
       //
-      // only supports PC ANSI, VT100, VT100+, VT-UTF8, and TtyTerm terminal types
+      // only supports PC ANSI, VT100, VT100+, VT-UTF8, TtyTerm
+      // Linux, XtermR6, VT400 and SCO terminal types
       //
       if (TerminalTypeFromGuid (&Node->Guid) == ARRAY_SIZE (mTerminalType)) {
         return EFI_UNSUPPORTED;
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index b2f0901fc1..d683aa792f 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -1,7 +1,7 @@
 /** @file
   Header file for Terminal driver.
 
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -81,7 +81,11 @@ typedef enum {
   TerminalTypeVt100,
   TerminalTypeVt100Plus,
   TerminalTypeVtUtf8,
-  TerminalTypeTtyTerm
+  TerminalTypeTtyTerm,
+  TerminalTypeLinux,
+  TerminalTypeXtermR6,
+  TerminalTypeVt400,
+  TerminalTypeSCO
 } TERMINAL_TYPE;
 
 typedef struct {
@@ -126,7 +130,9 @@ typedef struct {
 #define INPUT_STATE_LEFTOPENBRACKET       0x04
 #define INPUT_STATE_O                     0x08
 #define INPUT_STATE_2                     0x10
-#define INPUT_STATE_LEFTOPENBRACKET_2     0x20
+#define INPUT_STATE_LEFTOPENBRACKET_TTY   0x20
+#define INPUT_STATE_1                     0x40
+#define INPUT_STATE_LEFTOPENBRACKET_2ND   0x80
 
 #define RESET_STATE_DEFAULT               0x00
 #define RESET_STATE_ESC_R                 0x01
@@ -848,7 +854,8 @@ TerminalRemoveConsoleDevVariable (
 /**
   Build termial device path according to terminal type.
 
-  @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+ or VT-UTF8.
+  @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+, VT-UTF8, TTY-Term,
+                                 Linux, XtermR6 or VT400.
   @param  ParentDevicePath       Parent device path.
   @param  TerminalDevicePath     Returned terminal device path, if building successfully.
 
@@ -1209,6 +1216,28 @@ AnsiRawDataToUnicode (
   | F12     | 0x16 |           | ESC @    |          |
   +=========+======+===========+==========+==========+
 
+Putty function key map:
+  +=========+======+===========+=============+=============+=============+=========+
+  |         | EFI  |           |             |             |             |         |
+  |         | Scan |           |             |  Normal     |             |         |
+  |   KEY   | Code |  VT100+   | Xterm R6    |  VT400      | Linux       | SCO     |
+  +=========+======+===========+=============+=============+=============+=========+
+  | F1      | 0x0B | ESC O P   | ESC O P     | ESC [ 1 1 ~ | ESC [ [ A   | ESC [ M |
+  | F2      | 0x0C | ESC O Q   | ESC O Q     | ESC [ 1 2 ~ | ESC [ [ B   | ESC [ N |
+  | F3      | 0x0D | ESC O R   | ESC O R     | ESC [ 1 3 ~ | ESC [ [ C   | ESC [ O |
+  | F4      | 0x0E | ESC O S   | ESC O S     | ESC [ 1 4 ~ | ESC [ [ D   | ESC [ P |
+  | F5      | 0x0F | ESC O T   | ESC [ 1 5 ~ | ESC [ 1 5 ~ | ESC [ [ E   | ESC [ Q |
+  | F6      | 0x10 | ESC O U   | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ R |
+  | F7      | 0x11 | ESC O V   | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ S |
+  | F8      | 0x12 | ESC O W   | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ T |
+  | F9      | 0x13 | ESC O X   | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ U |
+  | F10     | 0x14 | ESC O Y   | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ V |
+  | Escape  | 0x17 | ESC       | ESC         | ESC         | ESC         | ESC     |
+  | F11     | 0x15 | ESC O Z   | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ W |
+  | F12     | 0x16 | ESC O [   | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ X |
+  +=========+======+===========+=============+=============+=============+=========+
+
+
   Special Mappings
   ================
   ESC R ESC r ESC R = Reset System
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
index 4ede416774..fb2eda01e7 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
@@ -2,7 +2,7 @@
   Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
 
 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -453,6 +453,10 @@ TranslateRawDataToEfiKey (
   case TerminalTypeVt100:
   case TerminalTypeVt100Plus:
   case TerminalTypeTtyTerm:
+  case TerminalTypeLinux:
+  case TerminalTypeXtermR6:
+  case TerminalTypeVt400:
+  case TerminalTypeSCO:
     AnsiRawDataToUnicode (TerminalDevice);
     UnicodeToEfiKey (TerminalDevice);
     break;
@@ -1319,6 +1323,27 @@ UnicodeToEfiKeyFlushState (
   | F12     | 0x16 |           | ESC @    |          |
   +=========+======+===========+==========+==========+
 
+Putty function key map:
+  +=========+======+===========+=============+=============+=============+=========+
+  |         | EFI  |           |             |             |             |         |
+  |         | Scan |           |             |  Normal     |             |         |
+  |   KEY   | Code |  VT100+   | Xterm R6    |  VT400      | Linux       | SCO     |
+  +=========+======+===========+=============+=============+=============+=========+
+  | F1      | 0x0B | ESC O P   | ESC O P     | ESC [ 1 1 ~ | ESC [ [ A   | ESC [ M |
+  | F2      | 0x0C | ESC O Q   | ESC O Q     | ESC [ 1 2 ~ | ESC [ [ B   | ESC [ N |
+  | F3      | 0x0D | ESC O R   | ESC O R     | ESC [ 1 3 ~ | ESC [ [ C   | ESC [ O |
+  | F4      | 0x0E | ESC O S   | ESC O S     | ESC [ 1 4 ~ | ESC [ [ D   | ESC [ P |
+  | F5      | 0x0F | ESC O T   | ESC [ 1 5 ~ | ESC [ 1 5 ~ | ESC [ [ E   | ESC [ Q |
+  | F6      | 0x10 | ESC O U   | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ R |
+  | F7      | 0x11 | ESC O V   | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ S |
+  | F8      | 0x12 | ESC O W   | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ T |
+  | F9      | 0x13 | ESC O X   | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ U |
+  | F10     | 0x14 | ESC O Y   | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ V |
+  | Escape  | 0x17 | ESC       | ESC         | ESC         | ESC         | ESC     |
+  | F11     | 0x15 | ESC O Z   | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ W |
+  | F12     | 0x16 | ESC O [   | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ X |
+  +=========+======+===========+=============+=============+=============+=========+
+
   Special Mappings
   ================
   ESC R ESC r ESC R = Reset System
@@ -1378,7 +1403,9 @@ UnicodeToEfiKey (
       }
 
       if (UnicodeChar == 'O' && (TerminalDevice->TerminalType == TerminalTypeVt100 ||
-                                 TerminalDevice->TerminalType == TerminalTypeTtyTerm)) {
+                                 TerminalDevice->TerminalType == TerminalTypeTtyTerm ||
+                                 TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+                                 TerminalDevice->TerminalType == TerminalTypeVt100Plus)) {
         TerminalDevice->InputState |= INPUT_STATE_O;
         TerminalDevice->ResetState = RESET_STATE_DEFAULT;
         continue;
@@ -1548,6 +1575,60 @@ UnicodeToEfiKey (
           Key.ScanCode = SCAN_END;
           break;
         }
+      } else if (TerminalDevice->TerminalType == TerminalTypeVt100Plus) {
+        switch (UnicodeChar) {
+        case 'P':
+          Key.ScanCode = SCAN_F1;
+          break;
+        case 'Q':
+          Key.ScanCode = SCAN_F2;
+          break;
+        case 'R':
+          Key.ScanCode = SCAN_F3;
+          break;
+        case 'S':
+          Key.ScanCode = SCAN_F4;
+          break;
+        case 'T':
+          Key.ScanCode = SCAN_F5;
+          break;
+        case 'U':
+          Key.ScanCode = SCAN_F6;
+          break;
+        case 'V':
+          Key.ScanCode = SCAN_F7;
+          break;
+        case 'W':
+          Key.ScanCode = SCAN_F8;
+          break;
+        case 'X':
+          Key.ScanCode = SCAN_F9;
+          break;
+        case 'Y':
+          Key.ScanCode = SCAN_F10;
+          break;
+        case 'Z':
+          Key.ScanCode = SCAN_F11;
+          break;
+        case '[':
+          Key.ScanCode = SCAN_F12;
+          break;
+        }
+      } else if (TerminalDevice->TerminalType == TerminalTypeXtermR6) {
+        switch (UnicodeChar) {
+        case 'P':
+          Key.ScanCode = SCAN_F1;
+          break;
+        case 'Q':
+          Key.ScanCode = SCAN_F2;
+          break;
+        case 'R':
+          Key.ScanCode = SCAN_F3;
+          break;
+        case 'S':
+          Key.ScanCode = SCAN_F4;
+          break;
+        }
       }
 
       if (Key.ScanCode != SCAN_NULL) {
@@ -1564,15 +1645,33 @@ UnicodeToEfiKey (
 
     case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET:
 
+      if (UnicodeChar == '1' && (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+                                  TerminalDevice->TerminalType == TerminalTypeVt400 ||
+                                  TerminalDevice->TerminalType == TerminalTypeLinux)) {
+        TerminalDevice->InputState |= INPUT_STATE_1;
+        continue;
+      }
+
+      if (UnicodeChar == '2' && (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+                                  TerminalDevice->TerminalType == TerminalTypeVt400 ||
+                                  TerminalDevice->TerminalType == TerminalTypeLinux)) {
+        TerminalDevice->InputState |= INPUT_STATE_2;
+        continue;
+      }
+
+      if (UnicodeChar == LEFTOPENBRACKET && TerminalDevice->TerminalType == TerminalTypeLinux) {
+        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2ND;
+        continue;
+      }
+
       TerminalDevice->ResetState = RESET_STATE_DEFAULT;
 
       Key.ScanCode = SCAN_NULL;
 
       if (TerminalDevice->TerminalType == TerminalTypePcAnsi    ||
           TerminalDevice->TerminalType == TerminalTypeVt100     ||
-          TerminalDevice->TerminalType == TerminalTypeVt100Plus ||
-          TerminalDevice->TerminalType == TerminalTypeVtUtf8    ||
-          TerminalDevice->TerminalType == TerminalTypeTtyTerm) {
+          TerminalDevice->TerminalType == TerminalTypeVtUtf8 ||
+          TerminalDevice->TerminalType == TerminalTypeSCO) {
         switch (UnicodeChar) {
         case 'A':
           Key.ScanCode = SCAN_UP;
@@ -1614,12 +1713,15 @@ UnicodeToEfiKey (
         case 'X':
           if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
             Key.ScanCode = SCAN_DELETE;
+          } else if (TerminalDevice->TerminalType == TerminalTypeSCO) {
+            Key.ScanCode = SCAN_F12;
           }
           break;
         case 'P':
           if (TerminalDevice->TerminalType == TerminalTypeVt100) {
             Key.ScanCode = SCAN_DELETE;
-          } else if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          } else if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+                      TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F4;
           }
           break;
@@ -1629,7 +1731,8 @@ UnicodeToEfiKey (
           }
           break;
         case 'V':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F10;
           }
           break;
@@ -1644,7 +1747,8 @@ UnicodeToEfiKey (
           }
           break;
         case 'U':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F9;
           }
           break;
@@ -1654,40 +1758,52 @@ UnicodeToEfiKey (
           }
           break;
         case 'M':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F1;
           }
           break;
         case 'N':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F2;
           }
           break;
         case 'O':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F3;
           }
           break;
         case 'Q':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F5;
           }
           break;
         case 'R':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F6;
           }
           break;
         case 'S':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F7;
           }
           break;
         case 'T':
-          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
+          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
+              TerminalDevice->TerminalType == TerminalTypeSCO) {
             Key.ScanCode = SCAN_F8;
           }
           break;
+        case 'W':
+          if (TerminalDevice->TerminalType == TerminalTypeSCO) {
+            Key.ScanCode = SCAN_F11;
+          }
+          break;
         default :
           break;
         }
@@ -1704,10 +1820,105 @@ UnicodeToEfiKey (
           UnicodeChar <= '9') {
         TerminalDevice->TtyEscapeStr[0] = UnicodeChar;
         TerminalDevice->TtyEscapeIndex = 1;
-        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2;
+        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_TTY;
+        continue;
+      }
+
+      if (Key.ScanCode != SCAN_NULL) {
+        Key.UnicodeChar = 0;
+        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
+        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+        UnicodeToEfiKeyFlushState (TerminalDevice);
+        continue;
+      }
+
+      UnicodeToEfiKeyFlushState (TerminalDevice);
+
+      break;
+
+    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_1:
+
+      TerminalDevice->ResetState = RESET_STATE_DEFAULT;
+
+      Key.ScanCode = SCAN_NULL;
+
+      if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+          TerminalDevice->TerminalType == TerminalTypeVt400 ||
+          TerminalDevice->TerminalType == TerminalTypeLinux) {
+        switch (UnicodeChar) {
+        case '1':
+          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
+            Key.ScanCode = SCAN_F1;
+          }
+          break;
+        case '2':
+          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
+            Key.ScanCode = SCAN_F2;
+          }
+          break;
+        case '3':
+          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
+            Key.ScanCode = SCAN_F3;
+          }
+          break;
+        case '4':
+          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
+            Key.ScanCode = SCAN_F4;
+          }
+          break;
+        case '5':
+          if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+              TerminalDevice->TerminalType == TerminalTypeVt400) {
+            Key.ScanCode = SCAN_F5;
+          }
+          break;
+        case '7':
+          Key.ScanCode = SCAN_F6;
+          break;
+        case '8':
+          Key.ScanCode = SCAN_F7;
+          break;
+        case '9':
+          Key.ScanCode = SCAN_F8;
+          break;
+        }
+      }
+
+      if (Key.ScanCode != SCAN_NULL) {
+        Key.UnicodeChar = 0;
+        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
+        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+        UnicodeToEfiKeyFlushState (TerminalDevice);
         continue;
       }
 
+      UnicodeToEfiKeyFlushState (TerminalDevice);
+
+      break;
+
+    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_2:
+
+      TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+      Key.ScanCode = SCAN_NULL;
+      if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
+          TerminalDevice->TerminalType == TerminalTypeVt400 ||
+          TerminalDevice->TerminalType == TerminalTypeLinux) {
+        switch (UnicodeChar) {
+        case '0':
+          Key.ScanCode = SCAN_F9;
+          break;
+        case '1':
+          Key.ScanCode = SCAN_F10;
+          break;
+        case '3':
+          Key.ScanCode = SCAN_F11;
+          break;
+        case '4':
+          Key.ScanCode = SCAN_F12;
+          break;
+        }
+      }
+
       if (Key.ScanCode != SCAN_NULL) {
         Key.UnicodeChar = 0;
         EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
@@ -1720,8 +1931,44 @@ UnicodeToEfiKey (
 
       break;
 
+    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTOPENBRACKET_2ND:
+
+      TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+      Key.ScanCode = SCAN_NULL;
+
+      if (TerminalDevice->TerminalType == TerminalTypeLinux) {
+        switch (UnicodeChar) {
+        case 'A':
+          Key.ScanCode = SCAN_F1;
+          break;
+        case 'B':
+          Key.ScanCode = SCAN_F2;
+          break;
+        case 'C':
+          Key.ScanCode = SCAN_F3;
+          break;
+        case 'D':
+          Key.ScanCode = SCAN_F4;
+          break;
+        case 'E':
+          Key.ScanCode = SCAN_F5;
+          break;
+        }
+      }
+
+      if (Key.ScanCode != SCAN_NULL) {
+        Key.UnicodeChar = 0;
+        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
+        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
+        UnicodeToEfiKeyFlushState (TerminalDevice);
+        continue;
+      }
+
+      UnicodeToEfiKeyFlushState (TerminalDevice);
+
+      break;
 
-    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTOPENBRACKET_2:
+    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTOPENBRACKET_TTY:
       /*
        * Here we handle the VT220 escape codes that we accept.  This
        * state is only used by the TTY terminal type.
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index 7ef655cca5..aae470e956 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -222,6 +222,10 @@ TerminalConOutOutputString (
     case TerminalTypeVt100:
     case TerminalTypeVt100Plus:
     case TerminalTypeTtyTerm:
+    case TerminalTypeLinux:
+    case TerminalTypeXtermR6:
+    case TerminalTypeVt400:
+    case TerminalTypeSCO:
 
       if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar)) {
         //
diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
index 24e164ef4d..e3785c3436 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
@@ -5,7 +5,7 @@
 #  protocols based on Serial I/O protocol for serial devices including hotplug serial
 #  devices.
 #
-#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 #
@@ -69,6 +69,10 @@
   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
+  gEdkiiLinuxModeGuid                           ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
+  gEdkiiXtermR6Guid                             ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
+  gEdkiiVT400Guid                               ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
+  gEdkiiSCOGuid                                 ## SOMETIMES_CONSUMES ## GUID # used with a Vendor-Defined Messaging Device Path
   gEdkiiStatusCodeDataTypeVariableGuid          ## SOMETIMES_CONSUMES ## GUID
 
 [Protocols]
-- 
2.21.0.windows.1


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

* [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu
  2019-09-12  1:02 [PATCH 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types Gao, Zhichao
  2019-09-12  1:02 ` [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console Gao, Zhichao
  2019-09-12  1:02 ` [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types Gao, Zhichao
@ 2019-09-12  1:02 ` Gao, Zhichao
  2019-09-12  2:49   ` Wu, Hao A
  2 siblings, 1 reply; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-12  1:02 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Hao A Wu, Ray Ni

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186

Add the new introduced terminal types to related setup menu to change
the terminal type from setup. Most platforms would have its own
configure setup menu and they need to change it to support these.
The new introduced terminal types are Linux, XtermR6, VT400 and SCO.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 .../BootMaintenanceManager.h                  | 13 ++++---
 .../BootMaintenanceManagerStrings.uni         | 10 +++++-
 .../ConsoleOption.c                           | 35 ++++++-------------
 .../BootMaintenanceManagerUiLib/Data.c        | 16 ++++++---
 4 files changed, 40 insertions(+), 34 deletions(-)

diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
index ea3cdce794..822401e68c 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManager.h
@@ -1,7 +1,7 @@
 /** @file
 Header file for boot maintenance module.
 
-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include "FormGuid.h"
 
 #include <Guid/TtyTerm.h>
+#include <Guid/TerminalConExtendedType.h>
 #include <Guid/MdeModuleHii.h>
 #include <Guid/FileSystemVolumeLabelInfo.h>
 #include <Guid/GlobalVariable.h>
@@ -92,7 +93,11 @@ typedef enum _TYPE_OF_TERMINAL {
   TerminalTypeVt100,
   TerminalTypeVt100Plus,
   TerminalTypeVtUtf8,
-  TerminalTypeTtyTerm
+  TerminalTypeTtyTerm,
+  TerminalTypeLinux,
+  TerminalTypeXtermR6,
+  TerminalTypeVt400,
+  TerminalTypeSCO
 } TYPE_OF_TERMINAL;
 
 //
@@ -1301,12 +1306,12 @@ extern BM_MENU_OPTION             ConsoleOutMenu;
 extern BM_MENU_OPTION             ConsoleErrMenu;
 extern BM_MENU_OPTION             DriverMenu;
 extern BM_MENU_OPTION             TerminalMenu;
-extern UINT16                     TerminalType[5];
+extern UINT16                     TerminalType[9];
 extern COM_ATTR                   BaudRateList[19];
 extern COM_ATTR                   DataBitsList[4];
 extern COM_ATTR                   ParityList[5];
 extern COM_ATTR                   StopBitsList[3];
-extern EFI_GUID                   TerminalTypeGuid[5];
+extern EFI_GUID                   TerminalTypeGuid[9];
 extern EFI_DEVICE_PATH_PROTOCOL   EndDevicePath[];
 extern UINT16                     mFlowControlType[2];
 extern UINT32                     mFlowControlValue[2];
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni
index 2e67d27bd0..3d47473e6c 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManagerStrings.uni
@@ -1,7 +1,7 @@
 ///** @file
 //  String definitions for Boot Maintenance Utility.
 //
-//  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
+//  Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
 //  SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 //**/
@@ -233,6 +233,14 @@
                                        #language fr-FR  "VT_UTF8"
 #string STR_COM_TYPE_4                 #language en-US  "TTY_TERM"
                                        #language fr-FR  "TTY_TERM"
+#string STR_COM_TYPE_5                 #language en-US  "LINUX"
+                                       #language fr-FR  "LINUX"
+#string STR_COM_TYPE_6                 #language en-US  "XTERM_R6"
+                                       #language fr-FR  "XTERM_R6"
+#string STR_COM_TYPE_7                 #language en-US  "VT_400"
+                                       #language fr-FR  "VT_400"
+#string STR_COM_TYPE_8                 #language en-US  "SCO"
+                                       #language fr-FR  "SCO"
 #string STR_RESET                      #language en-US  "Reset System"
                                        #language fr-FR  "Reset System"
 #string STR_FORM_GOTO_MAIN             #language en-US  "Go Back To Main Page"
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
index 7a53b58771..b0641c5ee9 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
@@ -897,6 +897,7 @@ IsTerminalDevicePath (
   VENDOR_DEVICE_PATH        *Vendor;
   UART_DEVICE_PATH          *Uart;
   ACPI_HID_DEVICE_PATH      *Acpi;
+  UINTN                     Index;
 
   IsTerminal = FALSE;
 
@@ -929,37 +930,21 @@ IsTerminalDevicePath (
   }
 
   //
-  // There are four kinds of Terminal types
+  // There are 9 kinds of Terminal types
   // check to see whether this devicepath
   // is one of that type
   //
-  if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[0])) {
-    *Termi      = TerminalTypePcAnsi;
-    IsTerminal  = TRUE;
-  } else {
-    if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[1])) {
-      *Termi      = TerminalTypeVt100;
-      IsTerminal  = TRUE;
-    } else {
-      if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[2])) {
-        *Termi      = TerminalTypeVt100Plus;
-        IsTerminal  = TRUE;
-      } else {
-        if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[3])) {
-          *Termi      = TerminalTypeVtUtf8;
-          IsTerminal  = TRUE;
-        } else {
-          if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) {
-            *Termi      = TerminalTypeTtyTerm;
-            IsTerminal  = TRUE;
-          } else {
-            IsTerminal = FALSE;
-          }
-        }
-      }
+  for (Index = 0; Index < ARRAY_SIZE (TerminalTypeGuid); Index++) {
+    if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[Index])) {
+      *Termi = Index;
+      IsTerminal = TRUE;
     }
   }
 
+  if (Index == ARRAY_SIZE (TerminalTypeGuid)) {
+    IsTerminal = FALSE;
+  }
+
   if (!IsTerminal) {
     return FALSE;
   }
diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
index b9d86b09d8..5cd363c982 100644
--- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
+++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
@@ -1,7 +1,7 @@
 /** @file
 Define some data used for Boot Maint
 
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -16,12 +16,16 @@ EFI_IFR_GUID_LABEL  *mEndLabel = NULL;
 ///
 /// Terminal type string token storage
 ///
-UINT16              TerminalType[] = {
+UINT16              TerminalType[9] = {
   STRING_TOKEN(STR_COM_TYPE_0),
   STRING_TOKEN(STR_COM_TYPE_1),
   STRING_TOKEN(STR_COM_TYPE_2),
   STRING_TOKEN(STR_COM_TYPE_3),
   STRING_TOKEN(STR_COM_TYPE_4),
+  STRING_TOKEN(STR_COM_TYPE_5),
+  STRING_TOKEN(STR_COM_TYPE_6),
+  STRING_TOKEN(STR_COM_TYPE_7),
+  STRING_TOKEN(STR_COM_TYPE_8),
 };
 
 ///
@@ -248,10 +252,14 @@ COM_ATTR            StopBitsList[3] = {
 ///
 /// Guid for messaging path, used in Serial port setting.
 ///
-EFI_GUID            TerminalTypeGuid[] = {
+EFI_GUID            TerminalTypeGuid[9] = {
   DEVICE_PATH_MESSAGING_PC_ANSI,
   DEVICE_PATH_MESSAGING_VT_100,
   DEVICE_PATH_MESSAGING_VT_100_PLUS,
   DEVICE_PATH_MESSAGING_VT_UTF8,
-  EFI_TTY_TERM_GUID
+  EFI_TTY_TERM_GUID,
+  EDKII_LINUX_MODE_GUID,
+  EDKII_XTERM_R6_GUID,
+  EDKII_VT400_GUID,
+  EDKII_SCO_GUID
 };
-- 
2.21.0.windows.1


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

* Re: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  1:02 ` [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console Gao, Zhichao
@ 2019-09-12  2:42   ` Wu, Hao A
  2019-09-13 18:09     ` [edk2-devel] " Brian J. Johnson
                       ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Wu, Hao A @ 2019-09-12  2:42 UTC (permalink / raw)
  To: Gao, Zhichao, devel@edk2.groups.io; +Cc: Wang, Jian J, Ni, Ray

> -----Original Message-----
> From: Gao, Zhichao
> Sent: Thursday, September 12, 2019 9:02 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> Subject: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of
> Terminal console


Hello,

Entend -> Extend


> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> 
> A common terminal console software Putty support various types of
> keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
> VT100+ and SCO. Refer to the link:
> https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-
> funkeys
> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
>  .../Include/Guid/TerminalConExtendedType.h    | 25
> +++++++++++++++++++
>  MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
>  2 files changed, 31 insertions(+)
>  create mode 100644
> MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> 
> diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> new file mode 100644
> index 0000000000..18667413e8
> --- /dev/null
> +++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> @@ -0,0 +1,25 @@
> +/** @file
> +  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
> +
> +
> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__
> +#define __TERMINAL_CON_EXTENDED_TYPE_H__
> +
> +#define EDKII_LINUX_MODE_GUID   \
> +    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c,
> 0xa5 } }
> +
> +#define EDKII_XTERM_R6_GUID     \
> +    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c,
> 0xcb } }
> +
> +#define EDKII_VT400_GUID        \
> +    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2,
> 0xbd } }
> +
> +#define EDKII_SCO_GUID          \
> +    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1,
> 0x5a } }
> +


I would suggest to add corresponding GUID declarations just as what has been
done in:

MdePkg/Include/Guid/PcAnsi.h
MdeModulePkg/Include/Guid/TtyTerm.h


> +#endif
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 17beb45235..7528d52fcb 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -343,6 +343,12 @@
>    ## Include/Guid/TtyTerm.h
>    gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2,
> 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
> 
> +  ## Include/Guid/TerminalConExtendedType.h
> +  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a,
> 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
> +  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab,
> 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
> +  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c,
> 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
> +  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b,
> 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
> +


After this patch, there will be 3 header files that describe different terminal
modes supported in TerminalDxe driver:

MdePkg/Include/Guid/PcAnsi.h (PcAnsi, VT100, VT100+, VTUTF8)
MdeModulePkg/Include/Guid/TtyTerm.h (TtyTerm)
MdeModulePkg/Include/Guid/TerminalConExtendedType.h (Linux, Xterm R6, Vt400, SCO)

Do we have a plan to add those 5 non-UEFI modes in the UEFI spec?

If not, I am wondering is it possible to at least merge TtyTerm.h and
TerminalConExtendedType.h into one file so that we can avoid introducing new
header files every time new terminal modes are being added.

Best Regards,
Hao Wu


>    ## Include/Guid/HiiBootMaintenanceFormset.h
>    gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a,
> 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
> 
> --
> 2.21.0.windows.1


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

* Re: [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types
  2019-09-12  1:02 ` [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types Gao, Zhichao
@ 2019-09-12  2:44   ` Wu, Hao A
  0 siblings, 0 replies; 12+ messages in thread
From: Wu, Hao A @ 2019-09-12  2:44 UTC (permalink / raw)
  To: Gao, Zhichao, devel@edk2.groups.io, Ni, Ray; +Cc: Wang, Jian J

> -----Original Message-----
> From: Gao, Zhichao
> Sent: Thursday, September 12, 2019 9:02 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> Subject: [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal
> console support types
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> 
> Extend the support types of terminal console driver. New added types
> are Linux, XtermR6, VT400 and SCO.
> 
> Refer to
> https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-
> funkeys
> 
> Add the missing VT100+ function keys map.
> 
> Add F1-F12 function keys map for Linux, XtermR6, VT400 and SCO.


I will leave the patch to Ray for review.

Best Regards,
Hao Wu


> 
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
>  .../Universal/Console/TerminalDxe/Terminal.c  |  17 +-
>  .../Universal/Console/TerminalDxe/Terminal.h  |  37 ++-
>  .../Console/TerminalDxe/TerminalConIn.c       | 281 ++++++++++++++++--
>  .../Console/TerminalDxe/TerminalConOut.c      |   4 +
>  .../Console/TerminalDxe/TerminalDxe.inf       |   6 +-
>  5 files changed, 319 insertions(+), 26 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
> index c76b2c5100..526067d023 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c
> @@ -2,7 +2,7 @@
>    Produces Simple Text Input Protocol, Simple Text Input Extended Protocol
> and
>    Simple Text Output Protocol upon Serial IO Protocol.
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -28,7 +28,11 @@ EFI_GUID  *mTerminalType[] = {
>    &gEfiVT100Guid,
>    &gEfiVT100PlusGuid,
>    &gEfiVTUTF8Guid,
> -  &gEfiTtyTermGuid
> +  &gEfiTtyTermGuid,
> +  &gEdkiiLinuxModeGuid,
> +  &gEdkiiXtermR6Guid,
> +  &gEdkiiVT400Guid,
> +  &gEdkiiSCOGuid
>  };
> 
> 
> @@ -37,7 +41,11 @@ CHAR16 *mSerialConsoleNames[] = {
>    L"VT-100 Serial Console",
>    L"VT-100+ Serial Console",
>    L"VT-UTF8 Serial Console",
> -  L"Tty Terminal Serial Console"
> +  L"Tty Terminal Serial Console",
> +  L"Linux Mode Terminal Serial Console",
> +  L"Xterm R6 Terminal Serial Console",
> +  L"VT400 Terminal Serial Console",
> +  L"SCO Terminal Serial Console"
>  };
> 
>  TERMINAL_DEV  mTerminalDevTemplate = {
> @@ -187,7 +195,8 @@ TerminalDriverBindingSupported (
> 
>        }
>        //
> -      // only supports PC ANSI, VT100, VT100+, VT-UTF8, and TtyTerm terminal
> types
> +      // only supports PC ANSI, VT100, VT100+, VT-UTF8, TtyTerm
> +      // Linux, XtermR6, VT400 and SCO terminal types
>        //
>        if (TerminalTypeFromGuid (&Node->Guid) == ARRAY_SIZE
> (mTerminalType)) {
>          return EFI_UNSUPPORTED;
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
> b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
> index b2f0901fc1..d683aa792f 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
> @@ -1,7 +1,7 @@
>  /** @file
>    Header file for Terminal driver.
> 
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -81,7 +81,11 @@ typedef enum {
>    TerminalTypeVt100,
>    TerminalTypeVt100Plus,
>    TerminalTypeVtUtf8,
> -  TerminalTypeTtyTerm
> +  TerminalTypeTtyTerm,
> +  TerminalTypeLinux,
> +  TerminalTypeXtermR6,
> +  TerminalTypeVt400,
> +  TerminalTypeSCO
>  } TERMINAL_TYPE;
> 
>  typedef struct {
> @@ -126,7 +130,9 @@ typedef struct {
>  #define INPUT_STATE_LEFTOPENBRACKET       0x04
>  #define INPUT_STATE_O                     0x08
>  #define INPUT_STATE_2                     0x10
> -#define INPUT_STATE_LEFTOPENBRACKET_2     0x20
> +#define INPUT_STATE_LEFTOPENBRACKET_TTY   0x20
> +#define INPUT_STATE_1                     0x40
> +#define INPUT_STATE_LEFTOPENBRACKET_2ND   0x80
> 
>  #define RESET_STATE_DEFAULT               0x00
>  #define RESET_STATE_ESC_R                 0x01
> @@ -848,7 +854,8 @@ TerminalRemoveConsoleDevVariable (
>  /**
>    Build termial device path according to terminal type.
> 
> -  @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+ or
> VT-UTF8.
> +  @param  TerminalType           The terminal type is PC ANSI, VT100, VT100+,
> VT-UTF8, TTY-Term,
> +                                 Linux, XtermR6 or VT400.
>    @param  ParentDevicePath       Parent device path.
>    @param  TerminalDevicePath     Returned terminal device path, if building
> successfully.
> 
> @@ -1209,6 +1216,28 @@ AnsiRawDataToUnicode (
>    | F12     | 0x16 |           | ESC @    |          |
>    +=========+======+===========+==========+==========+
> 
> +Putty function key map:
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +  |         | EFI  |           |             |             |             |         |
> +  |         | Scan |           |             |  Normal     |             |         |
> +  |   KEY   | Code |  VT100+   | Xterm R6    |  VT400      | Linux       | SCO     |
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +  | F1      | 0x0B | ESC O P   | ESC O P     | ESC [ 1 1 ~ | ESC [ [ A   | ESC [ M |
> +  | F2      | 0x0C | ESC O Q   | ESC O Q     | ESC [ 1 2 ~ | ESC [ [ B   | ESC [ N |
> +  | F3      | 0x0D | ESC O R   | ESC O R     | ESC [ 1 3 ~ | ESC [ [ C   | ESC [ O |
> +  | F4      | 0x0E | ESC O S   | ESC O S     | ESC [ 1 4 ~ | ESC [ [ D   | ESC [ P |
> +  | F5      | 0x0F | ESC O T   | ESC [ 1 5 ~ | ESC [ 1 5 ~ | ESC [ [ E   | ESC [ Q |
> +  | F6      | 0x10 | ESC O U   | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ R |
> +  | F7      | 0x11 | ESC O V   | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ S |
> +  | F8      | 0x12 | ESC O W   | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ T |
> +  | F9      | 0x13 | ESC O X   | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ U |
> +  | F10     | 0x14 | ESC O Y   | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ V |
> +  | Escape  | 0x17 | ESC       | ESC         | ESC         | ESC         | ESC     |
> +  | F11     | 0x15 | ESC O Z   | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ W |
> +  | F12     | 0x16 | ESC O [   | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ X |
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +
> +
>    Special Mappings
>    ================
>    ESC R ESC r ESC R = Reset System
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> index 4ede416774..fb2eda01e7 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c
> @@ -2,7 +2,7 @@
>    Implementation for EFI_SIMPLE_TEXT_INPUT_PROTOCOL protocol.
> 
>  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
> -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -453,6 +453,10 @@ TranslateRawDataToEfiKey (
>    case TerminalTypeVt100:
>    case TerminalTypeVt100Plus:
>    case TerminalTypeTtyTerm:
> +  case TerminalTypeLinux:
> +  case TerminalTypeXtermR6:
> +  case TerminalTypeVt400:
> +  case TerminalTypeSCO:
>      AnsiRawDataToUnicode (TerminalDevice);
>      UnicodeToEfiKey (TerminalDevice);
>      break;
> @@ -1319,6 +1323,27 @@ UnicodeToEfiKeyFlushState (
>    | F12     | 0x16 |           | ESC @    |          |
>    +=========+======+===========+==========+==========+
> 
> +Putty function key map:
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +  |         | EFI  |           |             |             |             |         |
> +  |         | Scan |           |             |  Normal     |             |         |
> +  |   KEY   | Code |  VT100+   | Xterm R6    |  VT400      | Linux       | SCO     |
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +  | F1      | 0x0B | ESC O P   | ESC O P     | ESC [ 1 1 ~ | ESC [ [ A   | ESC [ M |
> +  | F2      | 0x0C | ESC O Q   | ESC O Q     | ESC [ 1 2 ~ | ESC [ [ B   | ESC [ N |
> +  | F3      | 0x0D | ESC O R   | ESC O R     | ESC [ 1 3 ~ | ESC [ [ C   | ESC [ O |
> +  | F4      | 0x0E | ESC O S   | ESC O S     | ESC [ 1 4 ~ | ESC [ [ D   | ESC [ P |
> +  | F5      | 0x0F | ESC O T   | ESC [ 1 5 ~ | ESC [ 1 5 ~ | ESC [ [ E   | ESC [ Q |
> +  | F6      | 0x10 | ESC O U   | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ 1 7 ~ | ESC [ R |
> +  | F7      | 0x11 | ESC O V   | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ 1 8 ~ | ESC [ S |
> +  | F8      | 0x12 | ESC O W   | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ 1 9 ~ | ESC [ T |
> +  | F9      | 0x13 | ESC O X   | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ 2 0 ~ | ESC [ U |
> +  | F10     | 0x14 | ESC O Y   | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ 2 1 ~ | ESC [ V |
> +  | Escape  | 0x17 | ESC       | ESC         | ESC         | ESC         | ESC     |
> +  | F11     | 0x15 | ESC O Z   | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ 2 3 ~ | ESC [ W |
> +  | F12     | 0x16 | ESC O [   | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ 2 4 ~ | ESC [ X |
> +
> +=========+======+===========+=============+=============+
> =============+=========+
> +
>    Special Mappings
>    ================
>    ESC R ESC r ESC R = Reset System
> @@ -1378,7 +1403,9 @@ UnicodeToEfiKey (
>        }
> 
>        if (UnicodeChar == 'O' && (TerminalDevice->TerminalType ==
> TerminalTypeVt100 ||
> -                                 TerminalDevice->TerminalType == TerminalTypeTtyTerm)) {
> +                                 TerminalDevice->TerminalType == TerminalTypeTtyTerm ||
> +                                 TerminalDevice->TerminalType == TerminalTypeXtermR6
> ||
> +                                 TerminalDevice->TerminalType == TerminalTypeVt100Plus))
> {
>          TerminalDevice->InputState |= INPUT_STATE_O;
>          TerminalDevice->ResetState = RESET_STATE_DEFAULT;
>          continue;
> @@ -1548,6 +1575,60 @@ UnicodeToEfiKey (
>            Key.ScanCode = SCAN_END;
>            break;
>          }
> +      } else if (TerminalDevice->TerminalType == TerminalTypeVt100Plus) {
> +        switch (UnicodeChar) {
> +        case 'P':
> +          Key.ScanCode = SCAN_F1;
> +          break;
> +        case 'Q':
> +          Key.ScanCode = SCAN_F2;
> +          break;
> +        case 'R':
> +          Key.ScanCode = SCAN_F3;
> +          break;
> +        case 'S':
> +          Key.ScanCode = SCAN_F4;
> +          break;
> +        case 'T':
> +          Key.ScanCode = SCAN_F5;
> +          break;
> +        case 'U':
> +          Key.ScanCode = SCAN_F6;
> +          break;
> +        case 'V':
> +          Key.ScanCode = SCAN_F7;
> +          break;
> +        case 'W':
> +          Key.ScanCode = SCAN_F8;
> +          break;
> +        case 'X':
> +          Key.ScanCode = SCAN_F9;
> +          break;
> +        case 'Y':
> +          Key.ScanCode = SCAN_F10;
> +          break;
> +        case 'Z':
> +          Key.ScanCode = SCAN_F11;
> +          break;
> +        case '[':
> +          Key.ScanCode = SCAN_F12;
> +          break;
> +        }
> +      } else if (TerminalDevice->TerminalType == TerminalTypeXtermR6) {
> +        switch (UnicodeChar) {
> +        case 'P':
> +          Key.ScanCode = SCAN_F1;
> +          break;
> +        case 'Q':
> +          Key.ScanCode = SCAN_F2;
> +          break;
> +        case 'R':
> +          Key.ScanCode = SCAN_F3;
> +          break;
> +        case 'S':
> +          Key.ScanCode = SCAN_F4;
> +          break;
> +        }
>        }
> 
>        if (Key.ScanCode != SCAN_NULL) {
> @@ -1564,15 +1645,33 @@ UnicodeToEfiKey (
> 
>      case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET:
> 
> +      if (UnicodeChar == '1' && (TerminalDevice->TerminalType ==
> TerminalTypeXtermR6 ||
> +                                  TerminalDevice->TerminalType == TerminalTypeVt400 ||
> +                                  TerminalDevice->TerminalType == TerminalTypeLinux)) {
> +        TerminalDevice->InputState |= INPUT_STATE_1;
> +        continue;
> +      }
> +
> +      if (UnicodeChar == '2' && (TerminalDevice->TerminalType ==
> TerminalTypeXtermR6 ||
> +                                  TerminalDevice->TerminalType == TerminalTypeVt400 ||
> +                                  TerminalDevice->TerminalType == TerminalTypeLinux)) {
> +        TerminalDevice->InputState |= INPUT_STATE_2;
> +        continue;
> +      }
> +
> +      if (UnicodeChar == LEFTOPENBRACKET && TerminalDevice-
> >TerminalType == TerminalTypeLinux) {
> +        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2ND;
> +        continue;
> +      }
> +
>        TerminalDevice->ResetState = RESET_STATE_DEFAULT;
> 
>        Key.ScanCode = SCAN_NULL;
> 
>        if (TerminalDevice->TerminalType == TerminalTypePcAnsi    ||
>            TerminalDevice->TerminalType == TerminalTypeVt100     ||
> -          TerminalDevice->TerminalType == TerminalTypeVt100Plus ||
> -          TerminalDevice->TerminalType == TerminalTypeVtUtf8    ||
> -          TerminalDevice->TerminalType == TerminalTypeTtyTerm) {
> +          TerminalDevice->TerminalType == TerminalTypeVtUtf8 ||
> +          TerminalDevice->TerminalType == TerminalTypeSCO) {
>          switch (UnicodeChar) {
>          case 'A':
>            Key.ScanCode = SCAN_UP;
> @@ -1614,12 +1713,15 @@ UnicodeToEfiKey (
>          case 'X':
>            if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
>              Key.ScanCode = SCAN_DELETE;
> +          } else if (TerminalDevice->TerminalType == TerminalTypeSCO) {
> +            Key.ScanCode = SCAN_F12;
>            }
>            break;
>          case 'P':
>            if (TerminalDevice->TerminalType == TerminalTypeVt100) {
>              Key.ScanCode = SCAN_DELETE;
> -          } else if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          } else if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +                      TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F4;
>            }
>            break;
> @@ -1629,7 +1731,8 @@ UnicodeToEfiKey (
>            }
>            break;
>          case 'V':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F10;
>            }
>            break;
> @@ -1644,7 +1747,8 @@ UnicodeToEfiKey (
>            }
>            break;
>          case 'U':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F9;
>            }
>            break;
> @@ -1654,40 +1758,52 @@ UnicodeToEfiKey (
>            }
>            break;
>          case 'M':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F1;
>            }
>            break;
>          case 'N':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F2;
>            }
>            break;
>          case 'O':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F3;
>            }
>            break;
>          case 'Q':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F5;
>            }
>            break;
>          case 'R':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F6;
>            }
>            break;
>          case 'S':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F7;
>            }
>            break;
>          case 'T':
> -          if (TerminalDevice->TerminalType == TerminalTypePcAnsi) {
> +          if (TerminalDevice->TerminalType == TerminalTypePcAnsi ||
> +              TerminalDevice->TerminalType == TerminalTypeSCO) {
>              Key.ScanCode = SCAN_F8;
>            }
>            break;
> +        case 'W':
> +          if (TerminalDevice->TerminalType == TerminalTypeSCO) {
> +            Key.ScanCode = SCAN_F11;
> +          }
> +          break;
>          default :
>            break;
>          }
> @@ -1704,10 +1820,105 @@ UnicodeToEfiKey (
>            UnicodeChar <= '9') {
>          TerminalDevice->TtyEscapeStr[0] = UnicodeChar;
>          TerminalDevice->TtyEscapeIndex = 1;
> -        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_2;
> +        TerminalDevice->InputState |= INPUT_STATE_LEFTOPENBRACKET_TTY;
> +        continue;
> +      }
> +
> +      if (Key.ScanCode != SCAN_NULL) {
> +        Key.UnicodeChar = 0;
> +        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
> +        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
> +        UnicodeToEfiKeyFlushState (TerminalDevice);
> +        continue;
> +      }
> +
> +      UnicodeToEfiKeyFlushState (TerminalDevice);
> +
> +      break;
> +
> +    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET |
> INPUT_STATE_1:
> +
> +      TerminalDevice->ResetState = RESET_STATE_DEFAULT;
> +
> +      Key.ScanCode = SCAN_NULL;
> +
> +      if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
> +          TerminalDevice->TerminalType == TerminalTypeVt400 ||
> +          TerminalDevice->TerminalType == TerminalTypeLinux) {
> +        switch (UnicodeChar) {
> +        case '1':
> +          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
> +            Key.ScanCode = SCAN_F1;
> +          }
> +          break;
> +        case '2':
> +          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
> +            Key.ScanCode = SCAN_F2;
> +          }
> +          break;
> +        case '3':
> +          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
> +            Key.ScanCode = SCAN_F3;
> +          }
> +          break;
> +        case '4':
> +          if (TerminalDevice->TerminalType == TerminalTypeVt400) {
> +            Key.ScanCode = SCAN_F4;
> +          }
> +          break;
> +        case '5':
> +          if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
> +              TerminalDevice->TerminalType == TerminalTypeVt400) {
> +            Key.ScanCode = SCAN_F5;
> +          }
> +          break;
> +        case '7':
> +          Key.ScanCode = SCAN_F6;
> +          break;
> +        case '8':
> +          Key.ScanCode = SCAN_F7;
> +          break;
> +        case '9':
> +          Key.ScanCode = SCAN_F8;
> +          break;
> +        }
> +      }
> +
> +      if (Key.ScanCode != SCAN_NULL) {
> +        Key.UnicodeChar = 0;
> +        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
> +        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
> +        UnicodeToEfiKeyFlushState (TerminalDevice);
>          continue;
>        }
> 
> +      UnicodeToEfiKeyFlushState (TerminalDevice);
> +
> +      break;
> +
> +    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET |
> INPUT_STATE_2:
> +
> +      TerminalDevice->InputState = INPUT_STATE_DEFAULT;
> +      Key.ScanCode = SCAN_NULL;
> +      if (TerminalDevice->TerminalType == TerminalTypeXtermR6 ||
> +          TerminalDevice->TerminalType == TerminalTypeVt400 ||
> +          TerminalDevice->TerminalType == TerminalTypeLinux) {
> +        switch (UnicodeChar) {
> +        case '0':
> +          Key.ScanCode = SCAN_F9;
> +          break;
> +        case '1':
> +          Key.ScanCode = SCAN_F10;
> +          break;
> +        case '3':
> +          Key.ScanCode = SCAN_F11;
> +          break;
> +        case '4':
> +          Key.ScanCode = SCAN_F12;
> +          break;
> +        }
> +      }
> +
>        if (Key.ScanCode != SCAN_NULL) {
>          Key.UnicodeChar = 0;
>          EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
> @@ -1720,8 +1931,44 @@ UnicodeToEfiKey (
> 
>        break;
> 
> +    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET |
> INPUT_STATE_LEFTOPENBRACKET_2ND:
> +
> +      TerminalDevice->InputState = INPUT_STATE_DEFAULT;
> +      Key.ScanCode = SCAN_NULL;
> +
> +      if (TerminalDevice->TerminalType == TerminalTypeLinux) {
> +        switch (UnicodeChar) {
> +        case 'A':
> +          Key.ScanCode = SCAN_F1;
> +          break;
> +        case 'B':
> +          Key.ScanCode = SCAN_F2;
> +          break;
> +        case 'C':
> +          Key.ScanCode = SCAN_F3;
> +          break;
> +        case 'D':
> +          Key.ScanCode = SCAN_F4;
> +          break;
> +        case 'E':
> +          Key.ScanCode = SCAN_F5;
> +          break;
> +        }
> +      }
> +
> +      if (Key.ScanCode != SCAN_NULL) {
> +        Key.UnicodeChar = 0;
> +        EfiKeyFiFoInsertOneKey (TerminalDevice, &Key);
> +        TerminalDevice->InputState = INPUT_STATE_DEFAULT;
> +        UnicodeToEfiKeyFlushState (TerminalDevice);
> +        continue;
> +      }
> +
> +      UnicodeToEfiKeyFlushState (TerminalDevice);
> +
> +      break;
> 
> -    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET |
> INPUT_STATE_LEFTOPENBRACKET_2:
> +    case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET |
> INPUT_STATE_LEFTOPENBRACKET_TTY:
>        /*
>         * Here we handle the VT220 escape codes that we accept.  This
>         * state is only used by the TTY terminal type.
> diff --git
> a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> index 7ef655cca5..aae470e956 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> @@ -222,6 +222,10 @@ TerminalConOutOutputString (
>      case TerminalTypeVt100:
>      case TerminalTypeVt100Plus:
>      case TerminalTypeTtyTerm:
> +    case TerminalTypeLinux:
> +    case TerminalTypeXtermR6:
> +    case TerminalTypeVt400:
> +    case TerminalTypeSCO:
> 
>        if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar)) {
>          //
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> index 24e164ef4d..e3785c3436 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> @@ -5,7 +5,7 @@
>  #  protocols based on Serial I/O protocol for serial devices including hotplug
> serial
>  #  devices.
>  #
> -#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
> +#  Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
>  #
> @@ -69,6 +69,10 @@
>    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
> +  gEdkiiLinuxModeGuid                           ## SOMETIMES_CONSUMES ## GUID #
> used with a Vendor-Defined Messaging Device Path
> +  gEdkiiXtermR6Guid                             ## SOMETIMES_CONSUMES ## GUID #
> used with a Vendor-Defined Messaging Device Path
> +  gEdkiiVT400Guid                               ## SOMETIMES_CONSUMES ## GUID #
> used with a Vendor-Defined Messaging Device Path
> +  gEdkiiSCOGuid                                 ## SOMETIMES_CONSUMES ## GUID #
> used with a Vendor-Defined Messaging Device Path
>    gEdkiiStatusCodeDataTypeVariableGuid          ## SOMETIMES_CONSUMES
> ## GUID
> 
>  [Protocols]
> --
> 2.21.0.windows.1


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

* Re: [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu
  2019-09-12  1:02 ` [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Gao, Zhichao
@ 2019-09-12  2:49   ` Wu, Hao A
  0 siblings, 0 replies; 12+ messages in thread
From: Wu, Hao A @ 2019-09-12  2:49 UTC (permalink / raw)
  To: Gao, Zhichao, devel@edk2.groups.io, Ni, Ray, Bi, Dandan,
	Dong, Eric
  Cc: Wang, Jian J, Ni, Ray

> -----Original Message-----
> From: Gao, Zhichao
> Sent: Thursday, September 12, 2019 9:03 AM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> Subject: [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types
> to related menu
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> 
> Add the new introduced terminal types to related setup menu to change
> the terminal type from setup. Most platforms would have its own
> configure setup menu and they need to change it to support these.
> The new introduced terminal types are Linux, XtermR6, VT400 and SCO.
> 


I will leave the patch to Ray, Dandan and Eric for review.

Best Regards,
Hao Wu


> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> ---
>  .../BootMaintenanceManager.h                  | 13 ++++---
>  .../BootMaintenanceManagerStrings.uni         | 10 +++++-
>  .../ConsoleOption.c                           | 35 ++++++-------------
>  .../BootMaintenanceManagerUiLib/Data.c        | 16 ++++++---
>  4 files changed, 40 insertions(+), 34 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> index ea3cdce794..822401e68c 100644
> ---
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> +++
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManager.h
> @@ -1,7 +1,7 @@
>  /** @file
>  Header file for boot maintenance module.
> 
> -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include "FormGuid.h"
> 
>  #include <Guid/TtyTerm.h>
> +#include <Guid/TerminalConExtendedType.h>
>  #include <Guid/MdeModuleHii.h>
>  #include <Guid/FileSystemVolumeLabelInfo.h>
>  #include <Guid/GlobalVariable.h>
> @@ -92,7 +93,11 @@ typedef enum _TYPE_OF_TERMINAL {
>    TerminalTypeVt100,
>    TerminalTypeVt100Plus,
>    TerminalTypeVtUtf8,
> -  TerminalTypeTtyTerm
> +  TerminalTypeTtyTerm,
> +  TerminalTypeLinux,
> +  TerminalTypeXtermR6,
> +  TerminalTypeVt400,
> +  TerminalTypeSCO
>  } TYPE_OF_TERMINAL;
> 
>  //
> @@ -1301,12 +1306,12 @@ extern BM_MENU_OPTION
> ConsoleOutMenu;
>  extern BM_MENU_OPTION             ConsoleErrMenu;
>  extern BM_MENU_OPTION             DriverMenu;
>  extern BM_MENU_OPTION             TerminalMenu;
> -extern UINT16                     TerminalType[5];
> +extern UINT16                     TerminalType[9];
>  extern COM_ATTR                   BaudRateList[19];
>  extern COM_ATTR                   DataBitsList[4];
>  extern COM_ATTR                   ParityList[5];
>  extern COM_ATTR                   StopBitsList[3];
> -extern EFI_GUID                   TerminalTypeGuid[5];
> +extern EFI_GUID                   TerminalTypeGuid[9];
>  extern EFI_DEVICE_PATH_PROTOCOL   EndDevicePath[];
>  extern UINT16                     mFlowControlType[2];
>  extern UINT32                     mFlowControlValue[2];
> diff --git
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManagerStrings.uni
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManagerStrings.uni
> index 2e67d27bd0..3d47473e6c 100644
> ---
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManagerStrings.uni
> +++
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc
> eManagerStrings.uni
> @@ -1,7 +1,7 @@
>  ///** @file
>  //  String definitions for Boot Maintenance Utility.
>  //
> -//  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
> +//  Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
>  //  SPDX-License-Identifier: BSD-2-Clause-Patent
>  //
>  //**/
> @@ -233,6 +233,14 @@
>                                         #language fr-FR  "VT_UTF8"
>  #string STR_COM_TYPE_4                 #language en-US  "TTY_TERM"
>                                         #language fr-FR  "TTY_TERM"
> +#string STR_COM_TYPE_5                 #language en-US  "LINUX"
> +                                       #language fr-FR  "LINUX"
> +#string STR_COM_TYPE_6                 #language en-US  "XTERM_R6"
> +                                       #language fr-FR  "XTERM_R6"
> +#string STR_COM_TYPE_7                 #language en-US  "VT_400"
> +                                       #language fr-FR  "VT_400"
> +#string STR_COM_TYPE_8                 #language en-US  "SCO"
> +                                       #language fr-FR  "SCO"
>  #string STR_RESET                      #language en-US  "Reset System"
>                                         #language fr-FR  "Reset System"
>  #string STR_FORM_GOTO_MAIN             #language en-US  "Go Back To Main
> Page"
> diff --git
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
> index 7a53b58771..b0641c5ee9 100644
> ---
> a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
> +++
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c
> @@ -897,6 +897,7 @@ IsTerminalDevicePath (
>    VENDOR_DEVICE_PATH        *Vendor;
>    UART_DEVICE_PATH          *Uart;
>    ACPI_HID_DEVICE_PATH      *Acpi;
> +  UINTN                     Index;
> 
>    IsTerminal = FALSE;
> 
> @@ -929,37 +930,21 @@ IsTerminalDevicePath (
>    }
> 
>    //
> -  // There are four kinds of Terminal types
> +  // There are 9 kinds of Terminal types
>    // check to see whether this devicepath
>    // is one of that type
>    //
> -  if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[0])) {
> -    *Termi      = TerminalTypePcAnsi;
> -    IsTerminal  = TRUE;
> -  } else {
> -    if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[1])) {
> -      *Termi      = TerminalTypeVt100;
> -      IsTerminal  = TRUE;
> -    } else {
> -      if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[2])) {
> -        *Termi      = TerminalTypeVt100Plus;
> -        IsTerminal  = TRUE;
> -      } else {
> -        if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[3])) {
> -          *Termi      = TerminalTypeVtUtf8;
> -          IsTerminal  = TRUE;
> -        } else {
> -          if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) {
> -            *Termi      = TerminalTypeTtyTerm;
> -            IsTerminal  = TRUE;
> -          } else {
> -            IsTerminal = FALSE;
> -          }
> -        }
> -      }
> +  for (Index = 0; Index < ARRAY_SIZE (TerminalTypeGuid); Index++) {
> +    if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[Index])) {
> +      *Termi = Index;
> +      IsTerminal = TRUE;
>      }
>    }
> 
> +  if (Index == ARRAY_SIZE (TerminalTypeGuid)) {
> +    IsTerminal = FALSE;
> +  }
> +
>    if (!IsTerminal) {
>      return FALSE;
>    }
> diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
> b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
> index b9d86b09d8..5cd363c982 100644
> --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
> +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c
> @@ -1,7 +1,7 @@
>  /** @file
>  Define some data used for Boot Maint
> 
> -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
>  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -16,12 +16,16 @@ EFI_IFR_GUID_LABEL  *mEndLabel = NULL;
>  ///
>  /// Terminal type string token storage
>  ///
> -UINT16              TerminalType[] = {
> +UINT16              TerminalType[9] = {
>    STRING_TOKEN(STR_COM_TYPE_0),
>    STRING_TOKEN(STR_COM_TYPE_1),
>    STRING_TOKEN(STR_COM_TYPE_2),
>    STRING_TOKEN(STR_COM_TYPE_3),
>    STRING_TOKEN(STR_COM_TYPE_4),
> +  STRING_TOKEN(STR_COM_TYPE_5),
> +  STRING_TOKEN(STR_COM_TYPE_6),
> +  STRING_TOKEN(STR_COM_TYPE_7),
> +  STRING_TOKEN(STR_COM_TYPE_8),
>  };
> 
>  ///
> @@ -248,10 +252,14 @@ COM_ATTR            StopBitsList[3] = {
>  ///
>  /// Guid for messaging path, used in Serial port setting.
>  ///
> -EFI_GUID            TerminalTypeGuid[] = {
> +EFI_GUID            TerminalTypeGuid[9] = {
>    DEVICE_PATH_MESSAGING_PC_ANSI,
>    DEVICE_PATH_MESSAGING_VT_100,
>    DEVICE_PATH_MESSAGING_VT_100_PLUS,
>    DEVICE_PATH_MESSAGING_VT_UTF8,
> -  EFI_TTY_TERM_GUID
> +  EFI_TTY_TERM_GUID,
> +  EDKII_LINUX_MODE_GUID,
> +  EDKII_XTERM_R6_GUID,
> +  EDKII_VT400_GUID,
> +  EDKII_SCO_GUID
>  };
> --
> 2.21.0.windows.1


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

* Re: [edk2-devel] [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  2:42   ` Wu, Hao A
@ 2019-09-13 18:09     ` Brian J. Johnson
  2019-09-16  0:32     ` Gao, Zhichao
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Brian J. Johnson @ 2019-09-13 18:09 UTC (permalink / raw)
  To: devel, hao.a.wu, Gao, Zhichao; +Cc: Wang, Jian J, Ni, Ray

On 9/11/19 9:42 PM, Wu, Hao A wrote:
>> -----Original Message-----
>> From: Gao, Zhichao
>> Sent: Thursday, September 12, 2019 9:02 AM
>> To: devel@edk2.groups.io
>> Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
>> Subject: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of
>> Terminal console
> 
> 
> Hello,
> 
> Entend -> Extend
> 
> 
>>
>> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
>>
>> A common terminal console software Putty support various types of
>> keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
>> VT100+ and SCO. Refer to the link:
>> https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-
>> funkeys
>>
>> Cc: Jian J Wang <jian.j.wang@intel.com>
>> Cc: Hao A Wu <hao.a.wu@intel.com>
>> Cc: Ray Ni <ray.ni@intel.com>
>> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
>> ---
>>   .../Include/Guid/TerminalConExtendedType.h    | 25
>> +++++++++++++++++++
>>   MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
>>   2 files changed, 31 insertions(+)
>>   create mode 100644
>> MdeModulePkg/Include/Guid/TerminalConExtendedType.h
>>
>> diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
>> b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
>> new file mode 100644
>> index 0000000000..18667413e8
>> --- /dev/null
>> +++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
>> @@ -0,0 +1,25 @@
>> +/** @file
>> +  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
>> +
>> +
>> +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>> +  SPDX-License-Identifier: BSD-2-Clause-Patent
>> +
>> +**/
>> +
>> +#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__
>> +#define __TERMINAL_CON_EXTENDED_TYPE_H__
>> +
>> +#define EDKII_LINUX_MODE_GUID   \
>> +    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c,
>> 0xa5 } }
>> +
>> +#define EDKII_XTERM_R6_GUID     \
>> +    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c,
>> 0xcb } }
>> +
>> +#define EDKII_VT400_GUID        \
>> +    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2,
>> 0xbd } }
>> +
>> +#define EDKII_SCO_GUID          \
>> +    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1,
>> 0x5a } }
>> +
> 
> 
> I would suggest to add corresponding GUID declarations just as what has been
> done in:
> 
> MdePkg/Include/Guid/PcAnsi.h
> MdeModulePkg/Include/Guid/TtyTerm.h
> 
> 
>> +#endif
>> diff --git a/MdeModulePkg/MdeModulePkg.dec
>> b/MdeModulePkg/MdeModulePkg.dec
>> index 17beb45235..7528d52fcb 100644
>> --- a/MdeModulePkg/MdeModulePkg.dec
>> +++ b/MdeModulePkg/MdeModulePkg.dec
>> @@ -343,6 +343,12 @@
>>     ## Include/Guid/TtyTerm.h
>>     gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2,
>> 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
>>
>> +  ## Include/Guid/TerminalConExtendedType.h
>> +  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a,
>> 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
>> +  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab,
>> 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
>> +  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c,
>> 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
>> +  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b,
>> 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
>> +
> 
> 
> After this patch, there will be 3 header files that describe different terminal
> modes supported in TerminalDxe driver:
> 
> MdePkg/Include/Guid/PcAnsi.h (PcAnsi, VT100, VT100+, VTUTF8)
> MdeModulePkg/Include/Guid/TtyTerm.h (TtyTerm)
> MdeModulePkg/Include/Guid/TerminalConExtendedType.h (Linux, Xterm R6, Vt400, SCO)
> 
> Do we have a plan to add those 5 non-UEFI modes in the UEFI spec?
> 

Yes, it's frustrating that the UEFI spec doesn't specify a serial 
terminal type which is in common use.  TtyTerm helped quite a lot with 
practical usability... these new terminal types should help even more.

Thanks,
Brian Johnson

> If not, I am wondering is it possible to at least merge TtyTerm.h and
> TerminalConExtendedType.h into one file so that we can avoid introducing new
> header files every time new terminal modes are being added.
> 
> Best Regards,
> Hao Wu
> 
> 
>>     ## Include/Guid/HiiBootMaintenanceFormset.h
>>     gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a,
>> 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
>>
>> --
>> 2.21.0.windows.1
> 
> 
> 
> 


-- 
Brian J. Johnson
Enterprise X86 Lab

Hewlett Packard Enterprise


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

* Re: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  2:42   ` Wu, Hao A
  2019-09-13 18:09     ` [edk2-devel] " Brian J. Johnson
@ 2019-09-16  0:32     ` Gao, Zhichao
  2019-09-16  5:12     ` Gao, Zhichao
  2019-09-16  5:15     ` Gao, Zhichao
  3 siblings, 0 replies; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-16  0:32 UTC (permalink / raw)
  To: Wu, Hao A, devel@edk2.groups.io; +Cc: Wang, Jian J, Ni, Ray



> -----Original Message-----
> From: Wu, Hao A
> Sent: Thursday, September 12, 2019 10:43 AM
> To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> of Terminal console
> 
> > -----Original Message-----
> > From: Gao, Zhichao
> > Sent: Thursday, September 12, 2019 9:02 AM
> > To: devel@edk2.groups.io
> > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> > Subject: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> of
> > Terminal console
> 
> 
> Hello,
> 
> Entend -> Extend

I would update it later.

> 
> 
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> >
> > A common terminal console software Putty support various types of
> > keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
> > VT100+ and SCO. Refer to the link:
> > https://www.ssh.com/ssh/putty/putty-
> manuals/0.68/Chapter4.html#config-
> > funkeys
> >
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Cc: Hao A Wu <hao.a.wu@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> > ---
> >  .../Include/Guid/TerminalConExtendedType.h    | 25
> > +++++++++++++++++++
> >  MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
> >  2 files changed, 31 insertions(+)
> >  create mode 100644
> > MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> >
> > diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > new file mode 100644
> > index 0000000000..18667413e8
> > --- /dev/null
> > +++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > @@ -0,0 +1,25 @@
> > +/** @file
> > +  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
> > +
> > +
> > +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +
> > +**/
> > +
> > +#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__ #define
> > +__TERMINAL_CON_EXTENDED_TYPE_H__
> > +
> > +#define EDKII_LINUX_MODE_GUID   \
> > +    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6,
> > +0x81, 0x7c,
> > 0xa5 } }
> > +
> > +#define EDKII_XTERM_R6_GUID     \
> > +    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97,
> > +0xec, 0x7c,
> > 0xcb } }
> > +
> > +#define EDKII_VT400_GUID        \
> > +    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f,
> > +0x6a, 0xa2,
> > 0xbd } }
> > +
> > +#define EDKII_SCO_GUID          \
> > +    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49,
> > +0xe9, 0xe1,
> > 0x5a } }
> > +
> 
> 
> I would suggest to add corresponding GUID declarations just as what has
> been done in:
> 
> MdePkg/Include/Guid/PcAnsi.h
> MdeModulePkg/Include/Guid/TtyTerm.h
> 
> 
> > +#endif
> > diff --git a/MdeModulePkg/MdeModulePkg.dec
> > b/MdeModulePkg/MdeModulePkg.dec index 17beb45235..7528d52fcb
> 100644
> > --- a/MdeModulePkg/MdeModulePkg.dec
> > +++ b/MdeModulePkg/MdeModulePkg.dec
> > @@ -343,6 +343,12 @@
> >    ## Include/Guid/TtyTerm.h
> >    gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2,
> > 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
> >
> > +  ## Include/Guid/TerminalConExtendedType.h
> > +  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a,
> > 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
> > +  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab,
> > 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
> > +  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75,
> 0x3c,
> > 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
> > +  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b,
> > 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
> > +
> 
> 
> After this patch, there will be 3 header files that describe different terminal
> modes supported in TerminalDxe driver:
> 
> MdePkg/Include/Guid/PcAnsi.h (PcAnsi, VT100, VT100+, VTUTF8)
> MdeModulePkg/Include/Guid/TtyTerm.h (TtyTerm)
> MdeModulePkg/Include/Guid/TerminalConExtendedType.h (Linux, Xterm
> R6, Vt400, SCO)
> 
> Do we have a plan to add those 5 non-UEFI modes in the UEFI spec?

No, we don't. But that can be taken into consideration.

> 
> If not, I am wondering is it possible to at least merge TtyTerm.h and
> TerminalConExtendedType.h into one file so that we can avoid introducing
> new header files every time new terminal modes are being added.

Great suggestion. For now,  I would merge the TerminatlConExtendedType.h into TtyTerm.h. If the uefi spec would add the new types, then we can put all the types into one header file.

Thanks,
Zhichao

> 
> Best Regards,
> Hao Wu
> 
> 
> >    ## Include/Guid/HiiBootMaintenanceFormset.h
> >    gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89,
> 0x8a,
> > 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
> >
> > --
> > 2.21.0.windows.1


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

* Re: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  2:42   ` Wu, Hao A
  2019-09-13 18:09     ` [edk2-devel] " Brian J. Johnson
  2019-09-16  0:32     ` Gao, Zhichao
@ 2019-09-16  5:12     ` Gao, Zhichao
  2019-09-16  5:15     ` Gao, Zhichao
  3 siblings, 0 replies; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-16  5:12 UTC (permalink / raw)
  To: Wu, Hao A, devel@edk2.groups.io
  Cc: Wang, Jian J, Ni, Ray, Roy Franz, ard.biesheuvel@linaro.org,
	Laszlo Ersek

Hi Roy, Ard, Laszlo,

Do you have any comment if I add the new terminal type to TtyTerm.h? As PcAnsi.h, the spec related types are put into one header file.

Thanks,
Zhichao

> -----Original Message-----
> From: Gao, Zhichao
> Sent: Monday, September 16, 2019 8:33 AM
> To: Wu, Hao A <hao.a.wu@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> of Terminal console
> 
> 
> 
> > -----Original Message-----
> > From: Wu, Hao A
> > Sent: Thursday, September 12, 2019 10:43 AM
> > To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> > Cc: Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: RE: [PATCH 1/3] MdeModulePkg: Entend the support keyboard
> > type of Terminal console
> >
> > > -----Original Message-----
> > > From: Gao, Zhichao
> > > Sent: Thursday, September 12, 2019 9:02 AM
> > > To: devel@edk2.groups.io
> > > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> > > Subject: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> > of
> > > Terminal console
> >
> >
> > Hello,
> >
> > Entend -> Extend
> 
> I would update it later.
> 
> >
> >
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> > >
> > > A common terminal console software Putty support various types of
> > > keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
> > > VT100+ and SCO. Refer to the link:
> > > https://www.ssh.com/ssh/putty/putty-
> > manuals/0.68/Chapter4.html#config-
> > > funkeys
> > >
> > > Cc: Jian J Wang <jian.j.wang@intel.com>
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> > > ---
> > >  .../Include/Guid/TerminalConExtendedType.h    | 25
> > > +++++++++++++++++++
> > >  MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
> > >  2 files changed, 31 insertions(+)
> > >  create mode 100644
> > > MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > >
> > > diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > new file mode 100644
> > > index 0000000000..18667413e8
> > > --- /dev/null
> > > +++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > @@ -0,0 +1,25 @@
> > > +/** @file
> > > +  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
> > > +
> > > +
> > > +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > +
> > > +**/
> > > +
> > > +#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__ #define
> > > +__TERMINAL_CON_EXTENDED_TYPE_H__
> > > +
> > > +#define EDKII_LINUX_MODE_GUID   \
> > > +    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6,
> > > +0x81, 0x7c,
> > > 0xa5 } }
> > > +
> > > +#define EDKII_XTERM_R6_GUID     \
> > > +    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97,
> > > +0xec, 0x7c,
> > > 0xcb } }
> > > +
> > > +#define EDKII_VT400_GUID        \
> > > +    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f,
> > > +0x6a, 0xa2,
> > > 0xbd } }
> > > +
> > > +#define EDKII_SCO_GUID          \
> > > +    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49,
> > > +0xe9, 0xe1,
> > > 0x5a } }
> > > +
> >
> >
> > I would suggest to add corresponding GUID declarations just as what
> > has been done in:
> >
> > MdePkg/Include/Guid/PcAnsi.h
> > MdeModulePkg/Include/Guid/TtyTerm.h
> >
> >
> > > +#endif
> > > diff --git a/MdeModulePkg/MdeModulePkg.dec
> > > b/MdeModulePkg/MdeModulePkg.dec index 17beb45235..7528d52fcb
> > 100644
> > > --- a/MdeModulePkg/MdeModulePkg.dec
> > > +++ b/MdeModulePkg/MdeModulePkg.dec
> > > @@ -343,6 +343,12 @@
> > >    ## Include/Guid/TtyTerm.h
> > >    gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f,
> 0xe2,
> > > 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
> > >
> > > +  ## Include/Guid/TerminalConExtendedType.h
> > > +  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a,
> > > 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
> > > +  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab,
> > > 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
> > > +  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75,
> > 0x3c,
> > > 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
> > > +  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda,
> 0x3b,
> > > 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
> > > +
> >
> >
> > After this patch, there will be 3 header files that describe different
> > terminal modes supported in TerminalDxe driver:
> >
> > MdePkg/Include/Guid/PcAnsi.h (PcAnsi, VT100, VT100+, VTUTF8)
> > MdeModulePkg/Include/Guid/TtyTerm.h (TtyTerm)
> > MdeModulePkg/Include/Guid/TerminalConExtendedType.h (Linux, Xterm
> R6,
> > Vt400, SCO)
> >
> > Do we have a plan to add those 5 non-UEFI modes in the UEFI spec?
> 
> No, we don't. But that can be taken into consideration.
> 
> >
> > If not, I am wondering is it possible to at least merge TtyTerm.h and
> > TerminalConExtendedType.h into one file so that we can avoid
> > introducing new header files every time new terminal modes are being
> added.
> 
> Great suggestion. For now,  I would merge the TerminatlConExtendedType.h
> into TtyTerm.h. If the uefi spec would add the new types, then we can put all
> the types into one header file.
> 
> Thanks,
> Zhichao
> 
> >
> > Best Regards,
> > Hao Wu
> >
> >
> > >    ## Include/Guid/HiiBootMaintenanceFormset.h
> > >    gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89,
> > 0x8a,
> > > 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
> > >
> > > --
> > > 2.21.0.windows.1


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

* Re: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-12  2:42   ` Wu, Hao A
                       ` (2 preceding siblings ...)
  2019-09-16  5:12     ` Gao, Zhichao
@ 2019-09-16  5:15     ` Gao, Zhichao
  2019-09-16 11:24       ` Laszlo Ersek
  3 siblings, 1 reply; 12+ messages in thread
From: Gao, Zhichao @ 2019-09-16  5:15 UTC (permalink / raw)
  To: Wu, Hao A, devel@edk2.groups.io
  Cc: Wang, Jian J, Ni, Ray, ard.biesheuvel@linaro.org, Laszlo Ersek

Hi Roy, Ard, Laszlo,

Do you have any comment if I add the new terminal type to TtyTerm.h? As PcAnsi.h, the spec mentioned terminal types are put into one header file.

Thanks,
Zhichao
> -----Original Message-----
> From: Gao, Zhichao
> Sent: Monday, September 16, 2019 8:33 AM
> To: Wu, Hao A <hao.a.wu@intel.com>; devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> Subject: RE: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> of Terminal console
> 
> 
> 
> > -----Original Message-----
> > From: Wu, Hao A
> > Sent: Thursday, September 12, 2019 10:43 AM
> > To: Gao, Zhichao <zhichao.gao@intel.com>; devel@edk2.groups.io
> > Cc: Wang, Jian J <jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>
> > Subject: RE: [PATCH 1/3] MdeModulePkg: Entend the support keyboard
> > type of Terminal console
> >
> > > -----Original Message-----
> > > From: Gao, Zhichao
> > > Sent: Thursday, September 12, 2019 9:02 AM
> > > To: devel@edk2.groups.io
> > > Cc: Wang, Jian J; Wu, Hao A; Ni, Ray
> > > Subject: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type
> > of
> > > Terminal console
> >
> >
> > Hello,
> >
> > Entend -> Extend
> 
> I would update it later.
> 
> >
> >
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186
> > >
> > > A common terminal console software Putty support various types of
> > > keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400,
> > > VT100+ and SCO. Refer to the link:
> > > https://www.ssh.com/ssh/putty/putty-
> > manuals/0.68/Chapter4.html#config-
> > > funkeys
> > >
> > > Cc: Jian J Wang <jian.j.wang@intel.com>
> > > Cc: Hao A Wu <hao.a.wu@intel.com>
> > > Cc: Ray Ni <ray.ni@intel.com>
> > > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> > > ---
> > >  .../Include/Guid/TerminalConExtendedType.h    | 25
> > > +++++++++++++++++++
> > >  MdeModulePkg/MdeModulePkg.dec                 |  6 +++++
> > >  2 files changed, 31 insertions(+)
> > >  create mode 100644
> > > MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > >
> > > diff --git a/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > new file mode 100644
> > > index 0000000000..18667413e8
> > > --- /dev/null
> > > +++ b/MdeModulePkg/Include/Guid/TerminalConExtendedType.h
> > > @@ -0,0 +1,25 @@
> > > +/** @file
> > > +  GUID definition for Linux, XtermR6, Vt400 and SCO terminal type.
> > > +
> > > +
> > > +  Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> > > +
> > > +**/
> > > +
> > > +#ifndef __TERMINAL_CON_EXTENDED_TYPE_H__ #define
> > > +__TERMINAL_CON_EXTENDED_TYPE_H__
> > > +
> > > +#define EDKII_LINUX_MODE_GUID   \
> > > +    { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a, 0x9c, 0x9b, 0xe6,
> > > +0x81, 0x7c,
> > > 0xa5 } }
> > > +
> > > +#define EDKII_XTERM_R6_GUID     \
> > > +    { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab, 0xbe, 0x1b, 0x97,
> > > +0xec, 0x7c,
> > > 0xcb } }
> > > +
> > > +#define EDKII_VT400_GUID        \
> > > +    { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75, 0x3c, 0x08, 0x6f,
> > > +0x6a, 0xa2,
> > > 0xbd } }
> > > +
> > > +#define EDKII_SCO_GUID          \
> > > +    { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda, 0x3b, 0xd6, 0x49,
> > > +0xe9, 0xe1,
> > > 0x5a } }
> > > +
> >
> >
> > I would suggest to add corresponding GUID declarations just as what
> > has been done in:
> >
> > MdePkg/Include/Guid/PcAnsi.h
> > MdeModulePkg/Include/Guid/TtyTerm.h
> >
> >
> > > +#endif
> > > diff --git a/MdeModulePkg/MdeModulePkg.dec
> > > b/MdeModulePkg/MdeModulePkg.dec index 17beb45235..7528d52fcb
> > 100644
> > > --- a/MdeModulePkg/MdeModulePkg.dec
> > > +++ b/MdeModulePkg/MdeModulePkg.dec
> > > @@ -343,6 +343,12 @@
> > >    ## Include/Guid/TtyTerm.h
> > >    gEfiTtyTermGuid                = { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f,
> 0xe2,
> > > 0x5f, 0xdd, 0x51, 0xef, 0x94 }}
> > >
> > > +  ## Include/Guid/TerminalConExtendedType.h
> > > +  gEdkiiLinuxModeGuid           = { 0xe4364a7f, 0xf825, 0x430e, { 0x9d, 0x3a,
> > > 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 } }
> > > +  gEdkiiXtermR6Guid             = { 0xfbfca56b, 0xbb36, 0x4b78, { 0xaa, 0xab,
> > > 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb } }
> > > +  gEdkiiVT400Guid               = { 0x8e46dddd, 0x3d49, 0x4a9d, { 0xb8, 0x75,
> > 0x3c,
> > > 0x08, 0x6f, 0x6a, 0xa2, 0xbd } }
> > > +  gEdkiiSCOGuid                 = { 0xfc7dd6e0, 0x813c, 0x434d, { 0xb4, 0xda,
> 0x3b,
> > > 0xd6, 0x49, 0xe9, 0xe1, 0x5a } }
> > > +
> >
> >
> > After this patch, there will be 3 header files that describe different
> > terminal modes supported in TerminalDxe driver:
> >
> > MdePkg/Include/Guid/PcAnsi.h (PcAnsi, VT100, VT100+, VTUTF8)
> > MdeModulePkg/Include/Guid/TtyTerm.h (TtyTerm)
> > MdeModulePkg/Include/Guid/TerminalConExtendedType.h (Linux, Xterm
> R6,
> > Vt400, SCO)
> >
> > Do we have a plan to add those 5 non-UEFI modes in the UEFI spec?
> 
> No, we don't. But that can be taken into consideration.
> 
> >
> > If not, I am wondering is it possible to at least merge TtyTerm.h and
> > TerminalConExtendedType.h into one file so that we can avoid
> > introducing new header files every time new terminal modes are being
> added.
> 
> Great suggestion. For now,  I would merge the TerminatlConExtendedType.h
> into TtyTerm.h. If the uefi spec would add the new types, then we can put all
> the types into one header file.
> 
> Thanks,
> Zhichao
> 
> >
> > Best Regards,
> > Hao Wu
> >
> >
> > >    ## Include/Guid/HiiBootMaintenanceFormset.h
> > >    gEfiIfrBootMaintenanceGuid      = { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89,
> > 0x8a,
> > > 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }}
> > >
> > > --
> > > 2.21.0.windows.1


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

* Re: [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console
  2019-09-16  5:15     ` Gao, Zhichao
@ 2019-09-16 11:24       ` Laszlo Ersek
  0 siblings, 0 replies; 12+ messages in thread
From: Laszlo Ersek @ 2019-09-16 11:24 UTC (permalink / raw)
  To: Gao, Zhichao, Wu, Hao A, devel@edk2.groups.io
  Cc: Wang, Jian J, Ni, Ray, ard.biesheuvel@linaro.org

Hi Zhichao,

On 09/16/19 07:15, Gao, Zhichao wrote:
> Hi Roy, Ard, Laszlo,
> 
> Do you have any comment if I add the new terminal type to TtyTerm.h? As PcAnsi.h, the spec mentioned terminal types are put into one header file.

I've seen the original posting. I have no particular comments.

In ArmVirtPkg, there is a build flag (-D TTY_TERMINAL) for setting
TtyTerm as the default terminal type. But, I don't use it, so I can't
comment from that perspective either.

So, from my side, the only request is that the current functionality
should not be regressed please.

Thanks
Laszlo

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

end of thread, other threads:[~2019-09-16 11:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-12  1:02 [PATCH 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types Gao, Zhichao
2019-09-12  1:02 ` [PATCH 1/3] MdeModulePkg: Entend the support keyboard type of Terminal console Gao, Zhichao
2019-09-12  2:42   ` Wu, Hao A
2019-09-13 18:09     ` [edk2-devel] " Brian J. Johnson
2019-09-16  0:32     ` Gao, Zhichao
2019-09-16  5:12     ` Gao, Zhichao
2019-09-16  5:15     ` Gao, Zhichao
2019-09-16 11:24       ` Laszlo Ersek
2019-09-12  1:02 ` [PATCH 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types Gao, Zhichao
2019-09-12  2:44   ` Wu, Hao A
2019-09-12  1:02 ` [PATCH 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Gao, Zhichao
2019-09-12  2:49   ` Wu, Hao A

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