From nobody Wed May 8 06:35:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47802+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47802+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569213153; cv=none; d=zoho.com; s=zohoarc; b=n4hG3/PYN9MZPWcZir5pj0ND2P4uM8FJptOzQr9qU+KYRwY5p/s5Uk/ZBtCCvnOy0qAE1VdyZhqRDp81RYp/NseLNCTwDIZibf1+HEM/XetzUfYmSMG4CSnMKWQEameUuz36xKnQtadkYrNztukFJILjeCWyOp4DRatVToaCCaM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569213153; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=gin14zOSoQ3cewZhSaODP/65/gxkrjCYOIq8gyJkB1k=; b=cyKPQcKg+YwRSkAsQtJx+4/KCsoTbEG1igO/4//yNlTEbnk2ht2VrYaCEytyFoFrJ9mxEd+0baxhtXicMjQa3dZpN9OGZABjYffb8YsLn2gplnBC7Jm/e4ehSQh0zmz0RLXQKVmFJkM0KMN2bPn+rxwVHxwsU3eqZyPnBZnlOX0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47802+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569213153050137.206432437099; Sun, 22 Sep 2019 21:32:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id QrqyYY1788612x29q0UoS2Ch; Sun, 22 Sep 2019 21:32:32 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by groups.io with SMTP; Sun, 22 Sep 2019 21:32:32 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 21:32:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="203045063" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2019 21:32:30 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Ard Biesheuvel , Laszlo Ersek , Liming Gao Subject: [edk2-devel] [PATCH V4 1/3] MdeModulePkg: Extend the support keyboard type of Terminal console Date: Mon, 23 Sep 2019 12:32:22 +0800 Message-Id: <20190923043225.15300-2-zhichao.gao@intel.com> In-Reply-To: <20190923043225.15300-1-zhichao.gao@intel.com> References: <20190923043225.15300-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: sKURvbbAn6DDGEbcfUmwpzI5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569213152; bh=XPNxxmecNYqe/Mam9jB2fTEFQU+qAlA/0wJEBtdc9UM=; h=Cc:Date:From:Reply-To:Subject:To; b=Iic5GbdZXk6NRpEjuK0YBGR5Ztjt3t3vOqcKWapKrPUqUzJ4Zzh/6GwbwXIg0vc9qQF WwIhu+JQqTya2eGrXAHBH1S/ttmFus2mtAwYrpFkcbZsYEh45cBCiOkPXPh0gUD74TuSW 5aduD2KEHSYvfS9YFAYR2uGwOqGPeCbGcFc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2186 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-funke= ys Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Ard Biesheuvel Cc: Laszlo Ersek Cc: Liming Gao Signed-off-by: Zhichao Gao Reviewed-by: Hao A Wu --- MdeModulePkg/Include/Guid/TtyTerm.h | 17 +++++++++++++++++ MdeModulePkg/MdeModulePkg.dec | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/MdeModulePkg/Include/Guid/TtyTerm.h b/MdeModulePkg/Include/Gui= d/TtyTerm.h index 8333344b9d..a87c1e8b3a 100644 --- a/MdeModulePkg/Include/Guid/TtyTerm.h +++ b/MdeModulePkg/Include/Guid/TtyTerm.h @@ -4,6 +4,7 @@ provide support for modern *nix terminals. =20 =20 Copyright (c) 2015 Linaro Ltd. +Copyright (c) 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -14,6 +15,22 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define EFI_TTY_TERM_GUID \ {0x7d916d80, 0x5bb1, 0x458c, {0xa4, 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef= , 0x94 } } =20 +#define EDKII_LINUX_TERM_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_TERM_GUID \ + {0xfc7dd6e0, 0x813c, 0x434d, {0xb4, 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1= , 0x5a } } + extern EFI_GUID gEfiTtyTermGuid; +extern EFI_GUID gEdkiiLinuxTermGuid; +extern EFI_GUID gEdkiiXtermR6Guid; +extern EFI_GUID gEdkiiVT400Guid; +extern EFI_GUID gEdkiiSCOTermGuid; =20 #endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 17beb45235..7f72c122fc 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -342,6 +342,10 @@ =20 ## Include/Guid/TtyTerm.h gEfiTtyTermGuid =3D { 0x7d916d80, 0x5bb1, 0x458c, {0xa4, = 0x8f, 0xe2, 0x5f, 0xdd, 0x51, 0xef, 0x94 }} + gEdkiiLinuxTermGuid =3D { 0xe4364a7f, 0xf825, 0x430e, {0x9d, = 0x3a, 0x9c, 0x9b, 0xe6, 0x81, 0x7c, 0xa5 }} + gEdkiiXtermR6Guid =3D { 0xfbfca56b, 0xbb36, 0x4b78, {0xaa, = 0xab, 0xbe, 0x1b, 0x97, 0xec, 0x7c, 0xcb }} + gEdkiiVT400Guid =3D { 0x8e46dddd, 0x3d49, 0x4a9d, {0xb8, = 0x75, 0x3c, 0x08, 0x6f, 0x6a, 0xa2, 0xbd }} + gEdkiiSCOTermGuid =3D { 0xfc7dd6e0, 0x813c, 0x434d, {0xb4, = 0xda, 0x3b, 0xd6, 0x49, 0xe9, 0xe1, 0x5a }} =20 ## Include/Guid/HiiBootMaintenanceFormset.h gEfiIfrBootMaintenanceGuid =3D { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89= , 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 }} --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47802): https://edk2.groups.io/g/devel/message/47802 Mute This Topic: https://groups.io/mt/34260939/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:35:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47803+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47803+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569213162; cv=none; d=zoho.com; s=zohoarc; b=QKkgLcF3J2SC5cOnPaiHXBK/ZYrxGAGGoo7v9PkbJeN9Od1jgu5YVPXcfACg8ivZelzhkTjRVyye65BuTKvmOGJbOWvCvjZMSNP5OzMn3q1qwfMUwSafMhqT6miQwWrEvB0zwR65bKWxmlnTUGg+ezmLdD1ASioWlS71r/IbO/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569213162; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=c6M+kCaLtJ28tro4s5ZZ+Y+2VUAfqCgSpVhaJUT6bHs=; b=SWVClF/aFRNHEUNvmNpXEY4CBA3ilZ4cwPTp2+gbNIlXqGBp9e0LV2Spv5771ojazgJ8KsJoKntFgNwSeQdWiAMeMEM5nYIkKI4ETh1qRGDawVJGxbMRqd/097cXuXjJ0v7bYXH5mqRzPPEFIxsPmUFzXc+rHjiPaTvs1/E2wY0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47803+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569213162894700.906642505559; Sun, 22 Sep 2019 21:32:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id cN9GYY1788612xbeZ3joM6BB; Sun, 22 Sep 2019 21:32:42 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Sun, 22 Sep 2019 21:32:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 21:32:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="203045071" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2019 21:32:32 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Liming Gao Subject: [edk2-devel] [PATCH V4 2/3] MdeModulePkg/TerminalDxe: Extend the terminal console support types Date: Mon, 23 Sep 2019 12:32:23 +0800 Message-Id: <20190923043225.15300-3-zhichao.gao@intel.com> In-Reply-To: <20190923043225.15300-1-zhichao.gao@intel.com> References: <20190923043225.15300-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: 8BXNe3wP571rdSkfVDMSZkzOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569213162; bh=cM9/YjxAKK1/Slly+qvJUipOHL5mQTENL/iKhzCnSWo=; h=Cc:Date:From:Reply-To:Subject:To; b=KvZAFm4547tvtZSY2JiHwOlZ+kB7czMi1uQvFFPG0a8dhUuslbCOMOOP4FIE9QHfsGP pFK6onTBig5+6bRjIkCEBaqtlMHYDbF1EPB+39Vo1c9pR+I6ZKTkfc8FH7eK799W+d2DY mS+lyRFCe/cWQBxtAIys9yond4DNyVAsMPk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2186 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-funke= ys Add the missing VT100+ function keys map. Add F1-F12 function keys map for Linux, XtermR6, VT400 and SCO. Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Liming Gao Signed-off-by: Zhichao Gao Reviewed-by: Ray Ni --- .../Universal/Console/TerminalDxe/Terminal.c | 17 +- .../Universal/Console/TerminalDxe/Terminal.h | 37 ++- .../Console/TerminalDxe/TerminalConIn.c | 282 ++++++++++++++++-- .../Console/TerminalDxe/TerminalConOut.c | 4 + .../Console/TerminalDxe/TerminalDxe.inf | 6 +- 5 files changed, 320 insertions(+), 26 deletions(-) diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c b/MdeMod= ulePkg/Universal/Console/TerminalDxe/Terminal.c index c76b2c5100..a98b690c8b 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. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -28,7 +28,11 @@ EFI_GUID *mTerminalType[] =3D { &gEfiVT100Guid, &gEfiVT100PlusGuid, &gEfiVTUTF8Guid, - &gEfiTtyTermGuid + &gEfiTtyTermGuid, + &gEdkiiLinuxTermGuid, + &gEdkiiXtermR6Guid, + &gEdkiiVT400Guid, + &gEdkiiSCOTermGuid }; =20 =20 @@ -37,7 +41,11 @@ CHAR16 *mSerialConsoleNames[] =3D { 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 Terminal Serial Console", + L"Xterm R6 Serial Console", + L"VT-400 Serial Console", + L"SCO Terminal Serial Console" }; =20 TERMINAL_DEV mTerminalDevTemplate =3D { @@ -187,7 +195,8 @@ TerminalDriverBindingSupported ( =20 } // - // only supports PC ANSI, VT100, VT100+, VT-UTF8, and TtyTerm termin= al types + // only supports PC ANSI, VT100, VT100+, VT-UTF8, TtyTerm + // Linux, XtermR6, VT400 and SCO terminal types // if (TerminalTypeFromGuid (&Node->Guid) =3D=3D ARRAY_SIZE (mTerminalT= ype)) { return EFI_UNSUPPORTED; diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h b/MdeMod= ulePkg/Universal/Console/TerminalDxe/Terminal.h index b2f0901fc1..378ace13ce 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. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -81,7 +81,11 @@ typedef enum { TerminalTypeVt100, TerminalTypeVt100Plus, TerminalTypeVtUtf8, - TerminalTypeTtyTerm + TerminalTypeTtyTerm, + TerminalTypeLinux, + TerminalTypeXtermR6, + TerminalTypeVt400, + TerminalTypeSCO } TERMINAL_TYPE; =20 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 =20 #define RESET_STATE_DEFAULT 0x00 #define RESET_STATE_ESC_R 0x01 @@ -848,7 +854,8 @@ TerminalRemoveConsoleDevVariable ( /** Build termial device path according to terminal type. =20 - @param TerminalType The terminal type is PC ANSI, VT100, VT10= 0+ or VT-UTF8. + @param TerminalType The terminal type is PC ANSI, VT100, VT10= 0+, VT-UTF8, TTY-Term, + Linux, XtermR6, VT400 and SCO. @param ParentDevicePath Parent device path. @param TerminalDevicePath Returned terminal device path, if buildin= g successfully. =20 @@ -1209,6 +1216,28 @@ AnsiRawDataToUnicode ( | F12 | 0x16 | | ESC @ | | +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ =20 +Putty function key map: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + | | EFI | | | | |= | + | | Scan | | | Normal | |= | + | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux |= SCO | + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + | 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 | + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + + Special Mappings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ESC R ESC r ESC R =3D Reset System diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/M= deModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 4ede416774..ac31f27984 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. =20 (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Copyright (C) 2016 Silicon Graphics, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -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 @ | | +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ =20 +Putty function key map: + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + | | EFI | | | | |= | + | | Scan | | | Normal | |= | + | KEY | Code | VT100+ | Xterm R6 | VT400 | Linux |= SCO | + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + | 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 | + +=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D= =3D=3D=3D+ + Special Mappings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ESC R ESC r ESC R =3D Reset System @@ -1378,7 +1403,9 @@ UnicodeToEfiKey ( } =20 if (UnicodeChar =3D=3D 'O' && (TerminalDevice->TerminalType =3D=3D T= erminalTypeVt100 || - TerminalDevice->TerminalType =3D=3D Termi= nalTypeTtyTerm)) { + TerminalDevice->TerminalType =3D=3D Termi= nalTypeTtyTerm || + TerminalDevice->TerminalType =3D=3D Termi= nalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D Termi= nalTypeVt100Plus)) { TerminalDevice->InputState |=3D INPUT_STATE_O; TerminalDevice->ResetState =3D RESET_STATE_DEFAULT; continue; @@ -1548,6 +1575,60 @@ UnicodeToEfiKey ( Key.ScanCode =3D SCAN_END; break; } + } else if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus= ) { + switch (UnicodeChar) { + case 'P': + Key.ScanCode =3D SCAN_F1; + break; + case 'Q': + Key.ScanCode =3D SCAN_F2; + break; + case 'R': + Key.ScanCode =3D SCAN_F3; + break; + case 'S': + Key.ScanCode =3D SCAN_F4; + break; + case 'T': + Key.ScanCode =3D SCAN_F5; + break; + case 'U': + Key.ScanCode =3D SCAN_F6; + break; + case 'V': + Key.ScanCode =3D SCAN_F7; + break; + case 'W': + Key.ScanCode =3D SCAN_F8; + break; + case 'X': + Key.ScanCode =3D SCAN_F9; + break; + case 'Y': + Key.ScanCode =3D SCAN_F10; + break; + case 'Z': + Key.ScanCode =3D SCAN_F11; + break; + case '[': + Key.ScanCode =3D SCAN_F12; + break; + } + } else if (TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6) { + switch (UnicodeChar) { + case 'P': + Key.ScanCode =3D SCAN_F1; + break; + case 'Q': + Key.ScanCode =3D SCAN_F2; + break; + case 'R': + Key.ScanCode =3D SCAN_F3; + break; + case 'S': + Key.ScanCode =3D SCAN_F4; + break; + } } =20 if (Key.ScanCode !=3D SCAN_NULL) { @@ -1564,15 +1645,34 @@ UnicodeToEfiKey ( =20 case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET: =20 + if (UnicodeChar =3D=3D '1' && (TerminalDevice->TerminalType =3D=3D T= erminalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D Term= inalTypeVt400 || + TerminalDevice->TerminalType =3D=3D Term= inalTypeLinux)) { + TerminalDevice->InputState |=3D INPUT_STATE_1; + continue; + } + + if (UnicodeChar =3D=3D '2' && (TerminalDevice->TerminalType =3D=3D T= erminalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D Term= inalTypeVt400 || + TerminalDevice->TerminalType =3D=3D Term= inalTypeLinux)) { + TerminalDevice->InputState |=3D INPUT_STATE_2; + continue; + } + + if (UnicodeChar =3D=3D LEFTOPENBRACKET && TerminalDevice->TerminalTy= pe =3D=3D TerminalTypeLinux) { + TerminalDevice->InputState |=3D INPUT_STATE_LEFTOPENBRACKET_2ND; + continue; + } + TerminalDevice->ResetState =3D RESET_STATE_DEFAULT; =20 Key.ScanCode =3D SCAN_NULL; =20 if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || TerminalDevice->TerminalType =3D=3D TerminalTypeVt100 || - TerminalDevice->TerminalType =3D=3D TerminalTypeVt100Plus || - TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || - TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm) { + TerminalDevice->TerminalType =3D=3D TerminalTypeVtUtf8 || + TerminalDevice->TerminalType =3D=3D TerminalTypeTtyTerm || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { switch (UnicodeChar) { case 'A': Key.ScanCode =3D SCAN_UP; @@ -1614,12 +1714,15 @@ UnicodeToEfiKey ( case 'X': if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { Key.ScanCode =3D SCAN_DELETE; + } else if (TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { + Key.ScanCode =3D SCAN_F12; } break; case 'P': if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt100) { Key.ScanCode =3D SCAN_DELETE; - } else if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAns= i) { + } else if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAns= i || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO)= { Key.ScanCode =3D SCAN_F4; } break; @@ -1629,7 +1732,8 @@ UnicodeToEfiKey ( } break; case 'V': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F10; } break; @@ -1644,7 +1748,8 @@ UnicodeToEfiKey ( } break; case 'U': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F9; } break; @@ -1654,40 +1759,52 @@ UnicodeToEfiKey ( } break; case 'M': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F1; } break; case 'N': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F2; } break; case 'O': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F3; } break; case 'Q': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F5; } break; case 'R': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F6; } break; case 'S': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F7; } break; case 'T': - if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi) { + if (TerminalDevice->TerminalType =3D=3D TerminalTypePcAnsi || + TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { Key.ScanCode =3D SCAN_F8; } break; + case 'W': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeSCO) { + Key.ScanCode =3D SCAN_F11; + } + break; default : break; } @@ -1704,10 +1821,105 @@ UnicodeToEfiKey ( UnicodeChar <=3D '9') { TerminalDevice->TtyEscapeStr[0] =3D UnicodeChar; TerminalDevice->TtyEscapeIndex =3D 1; - TerminalDevice->InputState |=3D INPUT_STATE_LEFTOPENBRACKET_2; + TerminalDevice->InputState |=3D INPUT_STATE_LEFTOPENBRACKET_TTY; + continue; + } + + if (Key.ScanCode !=3D SCAN_NULL) { + Key.UnicodeChar =3D 0; + EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); + TerminalDevice->InputState =3D INPUT_STATE_DEFAULT; + UnicodeToEfiKeyFlushState (TerminalDevice); + continue; + } + + UnicodeToEfiKeyFlushState (TerminalDevice); + + break; + + case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_1: + + TerminalDevice->ResetState =3D RESET_STATE_DEFAULT; + + Key.ScanCode =3D SCAN_NULL; + + if (TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux) { + switch (UnicodeChar) { + case '1': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt400) { + Key.ScanCode =3D SCAN_F1; + } + break; + case '2': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt400) { + Key.ScanCode =3D SCAN_F2; + } + break; + case '3': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt400) { + Key.ScanCode =3D SCAN_F3; + } + break; + case '4': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeVt400) { + Key.ScanCode =3D SCAN_F4; + } + break; + case '5': + if (TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400) { + Key.ScanCode =3D SCAN_F5; + } + break; + case '7': + Key.ScanCode =3D SCAN_F6; + break; + case '8': + Key.ScanCode =3D SCAN_F7; + break; + case '9': + Key.ScanCode =3D SCAN_F8; + break; + } + } + + if (Key.ScanCode !=3D SCAN_NULL) { + Key.UnicodeChar =3D 0; + EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); + TerminalDevice->InputState =3D INPUT_STATE_DEFAULT; + UnicodeToEfiKeyFlushState (TerminalDevice); continue; } =20 + UnicodeToEfiKeyFlushState (TerminalDevice); + + break; + + case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_2: + + TerminalDevice->InputState =3D INPUT_STATE_DEFAULT; + Key.ScanCode =3D SCAN_NULL; + if (TerminalDevice->TerminalType =3D=3D TerminalTypeXtermR6 || + TerminalDevice->TerminalType =3D=3D TerminalTypeVt400 || + TerminalDevice->TerminalType =3D=3D TerminalTypeLinux) { + switch (UnicodeChar) { + case '0': + Key.ScanCode =3D SCAN_F9; + break; + case '1': + Key.ScanCode =3D SCAN_F10; + break; + case '3': + Key.ScanCode =3D SCAN_F11; + break; + case '4': + Key.ScanCode =3D SCAN_F12; + break; + } + } + if (Key.ScanCode !=3D SCAN_NULL) { Key.UnicodeChar =3D 0; EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); @@ -1720,8 +1932,44 @@ UnicodeToEfiKey ( =20 break; =20 + case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTO= PENBRACKET_2ND: + + TerminalDevice->InputState =3D INPUT_STATE_DEFAULT; + Key.ScanCode =3D SCAN_NULL; + + if (TerminalDevice->TerminalType =3D=3D TerminalTypeLinux) { + switch (UnicodeChar) { + case 'A': + Key.ScanCode =3D SCAN_F1; + break; + case 'B': + Key.ScanCode =3D SCAN_F2; + break; + case 'C': + Key.ScanCode =3D SCAN_F3; + break; + case 'D': + Key.ScanCode =3D SCAN_F4; + break; + case 'E': + Key.ScanCode =3D SCAN_F5; + break; + } + } + + if (Key.ScanCode !=3D SCAN_NULL) { + Key.UnicodeChar =3D 0; + EfiKeyFiFoInsertOneKey (TerminalDevice, &Key); + TerminalDevice->InputState =3D INPUT_STATE_DEFAULT; + UnicodeToEfiKeyFlushState (TerminalDevice); + continue; + } + + UnicodeToEfiKeyFlushState (TerminalDevice); + + break; =20 - case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTO= PENBRACKET_2: + case INPUT_STATE_ESC | INPUT_STATE_LEFTOPENBRACKET | INPUT_STATE_LEFTO= PENBRACKET_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: =20 if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar= )) { // diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf b/M= deModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf index 24e164ef4d..b2a8aeba85 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 hot= plug serial # devices. # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # # @@ -69,6 +69,10 @@ gEfiVT100PlusGuid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path gEfiPcAnsiGuid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path gEfiTtyTermGuid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path + gEdkiiLinuxTermGuid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path + gEdkiiXtermR6Guid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path + gEdkiiVT400Guid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path + gEdkiiSCOTermGuid ## SOMETIMES_CONSUMES ## G= UID # used with a Vendor-Defined Messaging Device Path gEdkiiStatusCodeDataTypeVariableGuid ## SOMETIMES_CONSUMES ## G= UID =20 [Protocols] --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47803): https://edk2.groups.io/g/devel/message/47803 Mute This Topic: https://groups.io/mt/34260941/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Wed May 8 06:35:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47804+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47804+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1569213163; cv=none; d=zoho.com; s=zohoarc; b=HbLi7VFP5i0VkCYA73StEnifGkipb8Mog+boOVj9k7lkmfcuMmwTY+edmGXhJpfahRiaUPBKWW2rK665ObOGWl3Py80VO3fv+SHfPTznDn3jf7HJlLtPsCNiMN0Z5PyKKfOZ29StPrb6Hlasnx2l4qwn77BFq8hromPCSk1iT+w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569213163; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=O48mfIJ++NwCnt1TFK8OLn7MLurtc4XbCNgvQ6NgX28=; b=Bsk1eTMP6DPDFlmRFJBT5+Wowfv7hSlEfP6oEJzczeBGUPanD8PCFOyH6/moONM6wSRycN7zjwD8JJF0E0edCX7vIWHNCgXGWRxMXffcpZ5GGMI1QzW0fR1HbDRBnq5S1XQS3UwMf8t8pqU9ORMNp5cNe01rGfiqKkxP/sVHMH0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47804+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1569213163105108.46461759032218; Sun, 22 Sep 2019 21:32:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rImdYY1788612xVUAKOg8dac; Sun, 22 Sep 2019 21:32:42 -0700 X-Received: from mga17.intel.com (mga17.intel.com []) by groups.io with SMTP; Sun, 22 Sep 2019 21:32:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 21:32:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,539,1559545200"; d="scan'208";a="203045075" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 22 Sep 2019 21:32:34 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Ray Ni , Dandan Bi , Liming Gao Subject: [edk2-devel] [PATCH V4 3/3] MdeModulePkg/BM_UI: Add the new terminal types to related menu Date: Mon, 23 Sep 2019 12:32:24 +0800 Message-Id: <20190923043225.15300-4-zhichao.gao@intel.com> In-Reply-To: <20190923043225.15300-1-zhichao.gao@intel.com> References: <20190923043225.15300-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: St9MEd5pFSRa72GJaH6KcP0ox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1569213162; bh=CvxhsomghEqN2d3vWnFQG2frndsEuZUCOepjqm2zxpA=; h=Cc:Date:From:Reply-To:Subject:To; b=NQ8M8c9bqYj6bQEXTNsG56kipOOwqfFV0pNJqsHvfNdMiNgt6RR1CcNNXtn8msV6/2J RzIe2dRI9cm6FRllGKkPR5KLgAcdPOcPYJxO8RDTT/BoXJucySUr3d7y2zr7Is14BQ//B dx1RwNmIOIdvLS5+5FCnIzEwkJoAb7IDZ5I= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2186 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 Cc: Hao A Wu Cc: Ray Ni Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Zhichao Gao Reviewed-by: Dandan Bi --- .../BootMaintenanceManager.h | 12 ++++--- .../BootMaintenanceManagerStrings.uni | 10 +++++- .../ConsoleOption.c | 36 ++++++------------- .../BootMaintenanceManagerUiLib/Data.c | 16 ++++++--- 4 files changed, 40 insertions(+), 34 deletions(-) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenan= ceManager.h b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintena= nceManager.h index ea3cdce794..67847d8bf3 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManag= er.h +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManag= er.h @@ -1,7 +1,7 @@ /** @file Header file for boot maintenance module. =20 -Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -92,7 +92,11 @@ typedef enum _TYPE_OF_TERMINAL { TerminalTypeVt100, TerminalTypeVt100Plus, TerminalTypeVtUtf8, - TerminalTypeTtyTerm + TerminalTypeTtyTerm, + TerminalTypeLinux, + TerminalTypeXtermR6, + TerminalTypeVt400, + TerminalTypeSCO } TYPE_OF_TERMINAL; =20 // @@ -1301,12 +1305,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/BootMaintenan= ceManagerStrings.uni b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Boo= tMaintenanceManagerStrings.uni index 2e67d27bd0..3d47473e6c 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManag= erStrings.uni +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanceManag= erStrings.uni @@ -1,7 +1,7 @@ ///** @file // String definitions for Boot Maintenance Utility. // -// Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
+// Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
// 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 P= age" diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption= .c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/ConsoleOption.c index 7a53b58771..5d1c6d34e6 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; =20 IsTerminal =3D FALSE; =20 @@ -929,37 +930,22 @@ IsTerminalDevicePath ( } =20 // - // 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 =3D TerminalTypePcAnsi; - IsTerminal =3D TRUE; - } else { - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[1])) { - *Termi =3D TerminalTypeVt100; - IsTerminal =3D TRUE; - } else { - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[2])) { - *Termi =3D TerminalTypeVt100Plus; - IsTerminal =3D TRUE; - } else { - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[3])) { - *Termi =3D TerminalTypeVtUtf8; - IsTerminal =3D TRUE; - } else { - if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[4])) { - *Termi =3D TerminalTypeTtyTerm; - IsTerminal =3D TRUE; - } else { - IsTerminal =3D FALSE; - } - } - } + for (Index =3D 0; Index < ARRAY_SIZE (TerminalTypeGuid); Index++) { + if (CompareGuid (&Vendor->Guid, &TerminalTypeGuid[Index])) { + *Termi =3D Index; + IsTerminal =3D TRUE; + break; } } =20 + if (Index =3D=3D ARRAY_SIZE (TerminalTypeGuid)) { + IsTerminal =3D FALSE; + } + if (!IsTerminal) { return FALSE; } diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/Data.c b/MdeM= odulePkg/Library/BootMaintenanceManagerUiLib/Data.c index b9d86b09d8..21c4ef3d55 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 =20 -Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -16,12 +16,16 @@ EFI_IFR_GUID_LABEL *mEndLabel =3D NULL; /// /// Terminal type string token storage /// -UINT16 TerminalType[] =3D { +UINT16 TerminalType[9] =3D { 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), }; =20 /// @@ -248,10 +252,14 @@ COM_ATTR StopBitsList[3] =3D { /// /// Guid for messaging path, used in Serial port setting. /// -EFI_GUID TerminalTypeGuid[] =3D { +EFI_GUID TerminalTypeGuid[9] =3D { 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_TERM_GUID, + EDKII_XTERM_R6_GUID, + EDKII_VT400_GUID, + EDKII_SCO_TERM_GUID }; --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47804): https://edk2.groups.io/g/devel/message/47804 Mute This Topic: https://groups.io/mt/34260942/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-