22 Text Console Driver Design Guidelines
This chapter covers the general guidelines for implementing UEFI Drivers for devices that provide console services. This include devices that allow the user to input information though key press actions such as a keyboard or keypad, devices that provide text based output, and byte-stream devices like a UART that can be connected to a remote terminal to provide console services.
If a device is intended to be used as a console input device and that device must be available for use as a console input device while UEFI firmware is active, then a UEFI Driver must be implemented that produces both the Simple Text Input Protocol and the Simple Text Input Ex Protocol. The Simple Text In Protocols are produced for any device that can behave like a basic keyboard. This could be an actual keyboard such as USB or PS/2, a serial terminal, a remote network terminal such as Telnet, or a custom device that provide the ability for a user to perform actions that can be translated into UEFI compatible keystroke information.
If a device is intended to be used as a console output device while UEFI firmware is active, and that device is able to display text strings, then a UEFI Driver must be implemented that produces the Simple Text Output Protocol. The device must support an 80 column by 25 row character mode, and may optionally support additional modes. The device must either directly support or be able to emulate the following operations:
- Clear the display
- Scroll the display up
- Move cursor
- Turn cursor on and off
- Support 16 foreground colors
- Support 8 background colors
If a device is graphics controller that is able to emulate a text console using
bitmap fonts, then see Chapter 23 on the Graphics Output Protocol. The EDK II
provides a platform agnostic driver in the MdeModulePkg
in the directory
MdeModulePkg/Universal/Console/GraphicsConsoleDxe
that uses the services of a
Graphics Output Protocol and bitmap fonts to produce the Simple Text Output
Protocol.
If a device supports character based communication where data can be both transmitted and received character at a time, and the goal is to use that device for console services by connecting the device to terminal or terminal emulator, then a UEFI Driver must be implemented that produces the Serial I/O Protocol. This may include devices such as a UART style serial port or any other character based I/O device on a motherboard, an add-in card, or USB.
The EDK II provides a terminal driver that supports the PC-ANSI, VT-100,
VT-100+, and VT-UTF8 terminal types. This terminal driver is in the
MdeModulePkg
in the directory MdeModulePkg/Universal/Console/TerminalDxe
.
This driver consumes the Serial I/O Protocol and produces all the
Simple Input Protocol, the Simple Input Ex Protocol, and the Simple Text Output Protocol.