Roy Franz
2015-07-06 23:04:35 UTC
This patchset adds a new terminal type "TtyTerm", that better handles the
typical Linux terminal (xterm/rxvt/gnome terminal/tmux/screen/etc.) These often
treat backspace/delete differently than the existing EDK2 terminal types
expect, particularly in emulated environments where the emulated serial port is
connected to a graphical terminal rather than a serial console. Some terminals
use a mix of vt100 and vt200 escape codes for function key handling. Adding
vt220 function key support fixes the use of "F10" to save changes in BDS
configuration menus.
This patchset includes changes to make the terminal type build time configurable
for the QEMU Aarch64 configuration. Once this patchset goes in I will submit
patches for the other emulated ARM platforms as appropriate.
Note: While working on the function keys, I could not find any documentation
that matched the code/comments in TerminalConIn.c regarding VT100 function
keys. The VT100 only had 4 function keys (PF1-PF4), which are generally mapped
to F1-F4. In the code, F3/F4 don't match the VT100 documentation I found, and
I have no idea where the values for F5-F10 are from. I left the existing
VT100 terminal type escape code handling unchanged.
Changes since v1:
* Added handling of VT220 escape codes for function keys
* Fixed attribution PCD patch
* Removed '[' from patch 3 description line
Changes from Linuxterm RFC patchset:
* Change to ttyTerm name - nothing linux specific in patchset
* remove changes to Mde module, as changes not part of UEFI specification
Laszlo Ersek (1):
Add PCD for selecting terminal type at build time
Roy Franz (3):
Add "TtyTerm" terminal type to TerminalDxe
Treat ASCII 0x7F as backspace for TtyTerm terminals
Accept VT220 DEL and function keys for TTY terminal type
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++
ArmVirtPkg/ArmVirtPkg.dec | 7 ++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++-
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 +
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++
MdeModulePkg/MdeModulePkg.dec | 3 +
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 ++++++--
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 3 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 109 +++++++++++++++++++-
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
11 files changed, 201 insertions(+), 15 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/TtyTerm.h
typical Linux terminal (xterm/rxvt/gnome terminal/tmux/screen/etc.) These often
treat backspace/delete differently than the existing EDK2 terminal types
expect, particularly in emulated environments where the emulated serial port is
connected to a graphical terminal rather than a serial console. Some terminals
use a mix of vt100 and vt200 escape codes for function key handling. Adding
vt220 function key support fixes the use of "F10" to save changes in BDS
configuration menus.
This patchset includes changes to make the terminal type build time configurable
for the QEMU Aarch64 configuration. Once this patchset goes in I will submit
patches for the other emulated ARM platforms as appropriate.
Note: While working on the function keys, I could not find any documentation
that matched the code/comments in TerminalConIn.c regarding VT100 function
keys. The VT100 only had 4 function keys (PF1-PF4), which are generally mapped
to F1-F4. In the code, F3/F4 don't match the VT100 documentation I found, and
I have no idea where the values for F5-F10 are from. I left the existing
VT100 terminal type escape code handling unchanged.
Changes since v1:
* Added handling of VT220 escape codes for function keys
* Fixed attribution PCD patch
* Removed '[' from patch 3 description line
Changes from Linuxterm RFC patchset:
* Change to ttyTerm name - nothing linux specific in patchset
* remove changes to Mde module, as changes not part of UEFI specification
Laszlo Ersek (1):
Add PCD for selecting terminal type at build time
Roy Franz (3):
Add "TtyTerm" terminal type to TerminalDxe
Treat ASCII 0x7F as backspace for TtyTerm terminals
Accept VT220 DEL and function keys for TTY terminal type
ArmVirtPkg/ArmVirt.dsc.inc | 6 ++
ArmVirtPkg/ArmVirtPkg.dec | 7 ++
ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 12 ++-
ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf | 4 +
MdeModulePkg/Include/Guid/TtyTerm.h | 25 +++++
MdeModulePkg/MdeModulePkg.dec | 3 +
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.c | 44 ++++++--
MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 3 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c | 109 +++++++++++++++++++-
MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 2 +
MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf | 1 +
11 files changed, 201 insertions(+), 15 deletions(-)
create mode 100644 MdeModulePkg/Include/Guid/TtyTerm.h
--
2.1.4
2.1.4