summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Console
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/TerminalDxe: Terminal fifo buffer overflow.gechao2021-02-031-1/+1
| | | | | | | | | | | | | | | | | | | Fix the bug of terminal fifo buffer overflow with UINT8 type. typedef struct { UINT8 Head; UINT8 Tail; UINT8 Data[RAW_FIFO_MAX_NUMBER + 1]; } RAW_DATA_FIFO; RAW_FIFO_MAX_NUMBER is 256. the data buffer size is 257 (Index from 0 to 256), but the max value of the index, Head or Tail (UINT8), is 255. That means the last data of the data buffer would be always empty if we use Head/Tail to output/input the data correctly. And because of the incorrect buffer size the FIFO full check "((Tail + 1) % (RAW_FIFO_MAX_NUMBER + 1)) == Head" would never meet. Signed-off-by: gechao <gechao@greatwall.com.cn> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* MdeModulePkg/ConSplitter: Change StdErr color to EFI_LIGHTGRAYSamer El-Haj-Mahmoud2021-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConSplitter is using EFI_LIGHTGRAY foreground color for ConOut and EFI_MAGENTA for StdErr consoles. This is impacting the DebugLib output on that same serial console (e.g. DebugLibSerialPort) after gEfiStandardErrorDeviceGuid is installed on that port. The impact also extends to Linux serial console output in OVMF because it inherits the color setting from the firmware. This is inconsistent and annoying, with MAGENTA being barely legible on a black background. Let's change StdErr default color to LIGHTGRAY for consistency and readability. This results in the same color being used for all consoles sharing the same serial port (ConOut, StdErr, DebugLib, OS console). Platforms wishing to distinguish the colors of consoles can do so in their own Platform BDS initialization. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie> (On an RPi 4 platform where this was another annoyance)
* MdeModulePkg/Graphics: Fix spelling mistakesSamer El-Haj-Mahmoud2021-01-063-43/+43
| | | | | | | | | | | | | | Fix various spelling mistakes in GraphicsConsoleDxe, ConsPlitter, and SimpleTextOut header Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Cc: Pete Batard <pete@akeo.ie> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* MdeModulePkg/GraphicsConsoleDxe: Change default CursorVisible to FALSESamer El-Haj-Mahmoud2021-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://github.com/pftf/RPi4/issues/115 GraphicsConsoleDxe defaults the ConOut Mode.CursorVisible to TRUE. However, the driver never draws the cursor during init. This results in the first call to disable the cursor (using ConOut->EnableCursor(FALSE)) to actually draw the cursor on the screen, as the logic in FlushCursor depends on the Mode.CursorVisible state to determine if it should draw or erase the cursor. Fix by changing the default CursorVisible in this driver to FALSE. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <Ard.Biesheuvel@arm.com> Cc: Pete Batard <pete@akeo.ie> Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie> (On an RPi4 platform where we had this annoyance of an unwanted cursor displaying on top of the platform logo)
* MdeModulePkg: Fix spelling mistake for occurredMichael D Kinney2020-08-192-4/+4
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: stop abusing EFI_HANDLE for keystroke notify registrationLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | EFI_REGISTER_KEYSTROKE_NOTIFY and EFI_UNREGISTER_KEYSTROKE_NOTIFY require the notification handle to have type (VOID*). The notification handle has nothing to do with the EFI_HANDLE type. This change is a semantic fix; functionally, it's a no-op. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/TerminalDxe: Enhance the arrow keys supportGao, Zhichao2019-09-271-2/+6
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2219 First previous patch remove the VT100Plus's arrow keys' support. Add it back. The arrow keys would send ESC [A through to ESC [D. Add this support for the new introduced terminal type. 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> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/TerminalDxe: Extend the terminal console support typesZhichao Gao2019-09-245-26/+320
| | | | | | | | | | | | | | | | | | | | | 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> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/GraphicsConsoleDxe: Initialize the output modeZhichao Gao2019-06-132-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1412 Original logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(Mode = -1, invalid) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *clear the screen at this phase*) Changed logic: Connect the graphics device -> connect it as graphics consoles and initialize its parameters(initialize the mode to the user defined mode or the best mode. *directly set the mode value without using SetMode, that would not clear the screen) -> connect it as console spliter and add the device to the list(use SetMode to set mode to the user defined mode or the best mode the devices supported if the mode is invalid. *now the mode is already set, so it would not clear the screen*). Also remove the section of SetMode for debug version. Impact: as the text mode may not be an invalid value, the SetMode may have no chance to be called during reconnect the graphics device. That means the screen may not be cleaned after finishing reconnect operation. There is one common condition: shell command "recoonect -r". Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/ConSplitterDxe: Optimize the ConSplitterTextOutSetModeAaron Antone2019-06-132-12/+25
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1412 For Console Out device, it would always set all present devices' text out mode again through ConSplitterTextOutSetMode while adding devices. That may cause the screen cleared for serval times. So add a BOOLEAN to judge if it is adding device then we will not set the same text mode again for same console out device. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0934-225/+34
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Avoid key notification called more than onceDandan Bi2018-09-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=996 Issue: In current code logic, when a key is pressed, it will search the whole NotifyList to find whether a notification has been registered with the keystroke. if yes, it will en-queue the key for notification execution later. And now if different notification functions have been registered with the same key, then the key will be en-queued more than once. Then it will cause the notification executed more than once. This patch is to enhance the code logic to fix this issue. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ConPlatform: Support short-form USB device pathRuiyu Ni2018-09-123-199/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today's implementation does an exact device path match to check whether the device path of a console is in ConIn/ConOut/ErrOut. But that doesn't work for the USB keyboard. Because when a platform have multiple USB port, ConIn needs to carry all device paths corresponding to each port. Even worse, today's BDS core logic removes the device path from ConIn/ConOut/ErrOut when the connection to that device path fails. So if user switches the USB keyboard from one port to another across boot, the USB keyboard doesn't work in the second boot. ConPlatform driver solved this problem by adding the IsHotPlugDevice() function. So that for USB keyboard, ConPlatform doesn't care whether its device path is in ConIn or not. But the rule is too loose, and now causes platform BDS cannot control whether to enable USB keyboard as an active console. The patch changes ConPlatform to support USB short-form device path when checking whether the device path of a console is in ConIn/ConOut/ErrOut. The logic to always accept USB/PCCARD device as active console is removed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Removing ipf which is no longer supported from edk2.Chen A Chen2018-09-064-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing rules for Ipf sources file: * Remove the source file which path with "ipf" and also listed in [Sources.IPF] section of INF file. * Remove the source file which listed in [Components.IPF] section of DSC file and not listed in any other [Components] section. * Remove the embedded Ipf code for MDE_CPU_IPF. Removing rules for Inf file: * Remove IPF from VALID_ARCHITECTURES comments. * Remove DXE_SAL_DRIVER from LIBRARY_CLASS in [Defines] section. * Remove the INF which only listed in [Components.IPF] section in DSC. * Remove statements from [BuildOptions] that provide IPF specific flags. * Remove any IPF sepcific sections. Removing rules for Dec file: * Remove [Includes.IPF] section from Dec. Removing rules for Dsc file: * Remove IPF from SUPPORTED_ARCHITECTURES in [Defines] section of DSC. * Remove any IPF specific sections. * Remove statements from [BuildOptions] that provide IPF specific flags. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg TerminalDxe: Remove a redundant functionshenglei2018-08-212-37/+0
| | | | | | | | | | | | | | The function UnicodeFiFoGetKeyCount that is never called has been removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1062 Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: shenglei <shenglei.zhang@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg: Clean up source filesLiming Gao2018-06-2819-148/+148
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Terminal: Check status of OpenProtocol in BindingStartRuiyu Ni2018-05-031-1/+7
| | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=917 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/Terminal: ReadKeyStrokeEx always return key stateRuiyu Ni2018-03-061-5/+4
| | | | | | | | | Because terminal doesn't support shift and toggle key state, ReadKeyStrokeEx just sets the two states to 0. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ConSplitter: ReadKeyStrokeEx always return key stateRuiyu Ni2018-02-012-25/+151
| | | | | | | | | | | | | | Today's implementation only return key state when there is key. But when user doesn't press any key, the key state cannot be returned. The patch changes the ReadKeyStrokeEx() to always return the key state even there is no key pressed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com>
* MdeModulePkg/TerminalDxe: Fix PCANSI mapping for TRIANGLE and ARROWMichael D Kinney2017-11-131-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=761 When a TerminalType is set to PCANSI, characters in the range 0x00 to 0x1F are control characters. The mapping table for PCANSI maps TRIANGLE glyphs, ARROW_UP glyph, and ARROW_DOWN glyph into this control character range and that causes no characters to be displayed by PCANSI compatible terminal emulators. The mappings are updated so these glyphs are mapped to ANSI characters in the range 0x20 to 0x7E. GEOMETRICSHAPE_UP_TRIANGLE '^' GEOMETRICSHAPE_RIGHT_TRIANGLE '>' GEOMETRICSHAPE_DOWN_TRIANGLE 'v' GEOMETRICSHAPE_LEFT_TRIANGLE '<' ARROW_UP '^' ARROW_DOWN 'v' Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg: Update comments in SimpleTextInEx according to UEFI 2.7Dandan Bi2017-06-204-14/+26
| | | | | | | | | | | v2: Add some missing changes Ps2KeyboardDxe. Cc: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/TerminalDxe: Avoid always append device path to *DevRuiyu Ni2017-04-201-8/+59
| | | | | | | | | | | When TerminalDxe Start() is called multiple times, the old logic unconditionally appended the terminal device path candidates to *Dev (ConInDev/ConOutDev/ErrOutDev), resulting the volatile storage is full. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/ConPlatform: Support GOP created as PCI's grandsonRuiyu Ni2017-03-173-41/+9
| | | | | | | | | | | | | | | | | | | The original logic assumes GOP hande is son of PCI handle but it is not always true. Below wordings are from UEFI Spec: If a graphics device supports multiple frame buffers, then handles for the frame buffers must be created first, and then the handles for the video output devices can be created as children of the frame buffer handles. So the GOP handle could be grandson of the PCI handle. EfiBootManagerGetGopDevicePath(VideoController) is used to fix this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
* MdeModulePkg: Use EfiEventEmptyFunction from UefiLibStar Zeng2017-01-202-37/+3
| | | | | | | | | | | | | | | Use EfiEventEmptyFunction from UefiLib and remove the duplication of event empty function. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298 Cc: Feng Tian <feng.tian@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Remove superfluous return statementsThomas Huth2017-01-201-3/+0
| | | | | | | | | If the code eventually returns "Status" anyway, it does not make sense to explicitly return "Status" in case of an error, too. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePathHao Wu2017-01-161-1/+1
| | | | | | | | | Pass '&Node.Header' instead of '&Node' as the 1st parameter to function SetDevicePathNodeLength(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/TerminalDxe: Remove out-of-dated commentsRuiyu Ni2017-01-131-5/+0
| | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg/TerminalDxe: Fix driver model bugRuiyu Ni2017-01-111-663/+281
| | | | | | | | | | | | | | | | | TerminalDxe driver contains bugs in its DriverBindingStart(): 1. It cannot be started AGAIN using a different terminal type; 2. It doesn't install SimpleTextInput/SimpleTextOut when ConIn/ConOut doesn't contain its device path. The check is duplicated of the same logic in ConPlatform driver and can be removed. The patch optimized the code to remove the unnecessary gEfiCallerIdGuid protocol installation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Remove unnecessary NULL pointer checkRuiyu Ni2017-01-111-7/+2
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Separate state machine start/stop logicRuiyu Ni2017-01-111-26/+59
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Refine SetTerminalDevicePathRuiyu Ni2017-01-111-38/+3
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Refine InitializeTerminalConsoleTextModeRuiyu Ni2017-01-111-82/+26
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Separate controller name init logicRuiyu Ni2017-01-111-91/+56
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Add TerminalTypeFromGuid internal functionRuiyu Ni2017-01-111-26/+29
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Replace macro with enum for terminal typesRuiyu Ni2017-01-114-97/+100
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg TerminalDxe: Execute key notify func at TPL_CALLBACKStar Zeng2016-12-263-7/+284
| | | | | | | | | | | | | | | | | | Current implementation executes key notify function in TimerHandler at TPL_NOTIFY. The code change is to make key notify function executed at TPL_CALLBACK to reduce the time occupied at TPL_NOTIFY. The code will signal KeyNotify process event if the key pressed matches any key registered and insert the KeyData to the EFI Key queue for notify, then the KeyNotify process handler will invoke key notify functions at TPL_CALLBACK. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg ConSplitterDxe: Support toggle state syncStar Zeng2016-12-262-9/+194
| | | | | | | | | | | | | | | | | Register key notify for toggle state (CapsLock, NumLock and ScrollLock) sync between multiple keyboards. The implementation for this feature requires keyboard driver supports EFI_KEY_STATE_EXPOSED, and turns on physical TextInEx partial key report for toggle state sync. The virtual TextInEx will report the partial key after it is required by calling SetState(X | KEY_STATE_VALID_EXPOSED) explicitly. Cc: Ruiyu Ni <Ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
* MdeModulePkg/TerminalDxe: Initialize variable after declarationDandan Bi2016-12-201-1/+3
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Fix IA32 VS2015x86 build breakMichael Kinney2016-10-271-3/+3
| | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=190 The issue is with signed/unsigned comparisons between Mode->CursorRow and Row and Mode->CursorColumn and Column. The fix is to add typecast to UINTN for comparisons. Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Brian Johnson <bjohnson@sgi.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Brian Johnson <bjohnson@sgi.com>
* MdeModulePkg/Universal: Fix typos in commentsGary Lin2016-10-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - stardard -> standard - doule -> double - defalut -> default - Pacakge -> Package - globa -> global - responsiblity -> responsibility - outputed -> outputted - specifiecd -> specified - Resuts -> Results - the a -> a - suported -> supported - assocated -> associated - TURE -> TRUE - successfull -> successfully - excute -> execute - reseting -> resetting - Retrive -> Retrieve - funciton -> function - paramter -> parameter - dependecy -> dependency - boundry -> boundary - permenantly -> permanently Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/TerminalDxe: Handle more keys with TtyTermBrian J. Johnson2016-10-271-3/+21
| | | | | | | | | | | | | | | | | | The TtyTerm terminal driver is missing support for sequences produced by the page up, page down, insert, home, and end keys in some terimnal emulators. Add them. Tested under Ubuntu 16.04 using xterm 322-1ubuntu1, GNOME terminal 3.18.3-1ubuntu1, and XFCE terminal 0.6.3-2ubuntu1. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Kyle Roberts <kyroberts@sgi.com> Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Reviewed-by: Roy Franz <roy.franz@hpe.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Optimize TtyTerm cursor motionBrian J. Johnson2016-10-272-5/+33
| | | | | | | | | | | | | | | | | For TtyTerm terminals, output a shorter escape sequence when possible to move the cursor within the current line, and don't print any escape sequence if the cursor is already at the correct position. This removes extra cursor motion activity at the EFI shell prompt, improving performance. It also makes it possible in many cases to successfully use a terminal window which is taller than the driver's mode setting (eg. 80x25.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/TerminalDxe: Improve TtyTerm cursor position trackingBrian J. Johnson2016-10-271-0/+25
| | | | | | | | | | | | | | | | | | | | | When we print the last character on a line, the terminal driver wraps CursorRow/CursorColumn to the beginning of the next line. But the terminal itself doesn't wrap its cursor until the next character is printed. That throws off the driver's cursor position tracking. So when we have printed the last character on a line, and are not in the middle of outputing an escape sequence, synchronize the terminal with the driver by outputing CR+LF. This matches the expected behavior, and the behavior of the VGA console driver. Only change the behavior of TtyTerm, not the other terminal types. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brian Johnson <bjohnson@sgi.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg/GraphicsOutputDxe.inf: Correct the protocol/GUID usagesRuiyu Ni2016-10-251-5/+5
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg: Add GraphicsOutputDxe driver.Ruiyu Ni2016-10-124-0/+1042
| | | | | | | | | | | | | | The driver uses the GraphicsInfo HOB and GraphicsDeviceInfo HOB passed from PEI to find the graphics controller to manage and produce the GraphicsOutput protocol. GraphicsInfo HOB and GraphicsDeviceInfo HOB are created by a PEIM which initializes the graphics controller hardware in PEI phase. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* MdeModulePkg: Fix typos in comments and variablesGiri P Mudusuru2016-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - abstrated to abstracted - accessibla to accessible - addres to address - apropriate to appropriate - arry to array - availabe to available - avaliable to available - becasue to because - correponding to corresponding - etablished to established - exeuction to execution - extensiable to extensible - fileds to fields - loadding to loading - ptototypes to prototypes - prococol protocol - requried to required - resoruce to resource - runing to running - uild to build Cc: Star Zeng <star.zeng@intel.com> Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
* Revert "TerminalDxe: select the UART's default receive FIFO depth"Ruiyu Ni2016-04-012-2/+2
| | | | | | | | | | | | | | This reverts commit 31ae446b1a039a55d0336f2201d77d1032533413. Changing the receive FIFO depth in Terminal driver Start() is not recommended. A new PCD PcdUartDefaultReceiveFifoDepth was added and MdeModulePkg/SerialDxe driver uses the PCD as the default receive FIFO depth. Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
* MdeModulePkg: ConSplitterDxe: use U64 mult/div wrappers in AbsPtr scalingLaszlo Ersek2016-03-161-3/+24
| | | | | | | | | This is an emergency fix for UINT64 multiplications and divisions not being done with the right BaseLib functions -- they break Ia32 builds. Fixes: 30ed3422ab2de03abf7c1433ebb482f6e5e16f45 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* MdeModulePkg: Rescale ConSplitter Absolute Pointer.Derek Lin2016-03-161-7/+36
| | | | | | | | | | ConSplitter's Absolute Pointer should scale virtual device's resolution like what Simple Pointer do. Before this change, caller will get Virtual device's resolution but physical device's current point. This change let caller get Virtual device's resolution with virtual device's current point. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Derek Lin <derek.lin2@hpe.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
* MdeModulePkg: TerminalDxe: select the UART's default receive FIFO depthLaszlo Ersek2016-01-212-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Serial IO protocol instances provided by SerialDxe and consumed by TerminalDxe come with a Mode.ReceiveFifoDepth=1 default setting, as required by UEFI 2.5. Although TerminalDxe calls EFI_SERIAL_IO_PROTOCOL.SetAttributes() in the TerminalDriverBindingStart() and TerminalConInTimerHandler() functions, it only does so to change the Mode.Timeout member. Other members of Mode, including Mode.ReceiveFifoDepth, are preserved. On some platforms this causes the UART that underlies TerminalDxe not to have enough room for bursts of scan codes, which translates to broken parsing of escape sequences, e.g. cursor movement keys. According to the UEFI spec, passing ReceiveFifoDepth=0 to EFI_SERIAL_IO_PROTOCOL.SetAttributes() "will use the device's default FIFO depth". While TerminalDxe could try to configure a receive FIFO depth that matches the longest escape sequence it wishes to parse, in practice the device-specific default FIFO depth -- which may well differ from the spec-mandated SerialIo->Mode.ReceiveFifoDepth=1 default -- seems to work. Hence let's just set that. This issue was exposed by SVN r18971 / git commit 921e987b2b ("ArmPlatformPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkg"). In that conversion, MdeModulePkg's SerialDxe started to initialize Mode.ReceiveFifoDepth to 1 (in conformance with the spec), unlike the prior, non-conformant initialization to 0 in EmbeddedPkg's SerialDxe. Since TerminalDxe would never change ReceiveFifoDepth from the new default value 1, and the ArmPlatformPkg/Drivers/PL011Uart library instance, underlying SerialDxe through SerialPortLib, would obey it too, they would collectively effect a receive queue depth of 1, rather than the default 16 or 32. This broke cursor keys on the ARM FVP and Juno platforms. It is the client of EFI_SERIAL_IO_PROTOCOL that is responsible for modifying the attributes, if the defaults are not appropriate, hence this patch modifies TerminalDxe. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ryan Harkin <ryan.harkin@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Star Zeng <star.zeng@intel.com> Reported-by: Ryan Harkin <ryan.harkin@linaro.org> Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/4779/focus=6553 Reference: http://thread.gmane.org/gmane.comp.bios.edk2.devel/6594 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19701 6f19259b-4bc3-4df7-8a09-765794883524