# TerminalSrc

| Index | Module | Size | Phase |
|-------|--------|------|-------|
| 132 | TerminalSrc | 40,160 bytes (39 KB) | Decompiled |

TerminalSrc is the UEFI terminal emulation driver for the HR650X BIOS. It provides serial console input/output by implementing the EFI_SIMPLE_TEXT_INPUT_PROTOCOL and EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL over a serial connection, with ACPI SPCR table installation for OS-level serial console redirection. The driver supports ANSI/VT100 escape sequence parsing, UTF-8 multi-byte decoding, and 80x25 / 100x31 display modes with 8-color foreground/background support.

## Key Functions

- ModuleEntryPoint, TerminalDriverEntry
- TerminalDetectSerialPorts, TerminalSetupSerialPort
- TerminalSerialReset, TerminalSerialWrite, TerminalSerialRead
- TerminalRingBufferRead, TerminalRingWrite, TerminalUtf8Decode
- TerminalRingToKeyQueue, TerminalKeyRingDequeue, TerminalSerialToKey
- TerminalConInReset, TerminalConInCheckKey, TerminalConInProcessSerial
- TerminalConOutOutputString, TerminalConOutSetAttribute, TerminalConOutSetMode
- ConOutOutputString, ConInReadKeyStroke

## Dependencies

- EFI_SERIAL_IO_PROTOCOL, EFI_SIMPLE_TEXT_INPUT_PROTOCOL, EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
- UefiBootServicesTableLib, UefiRuntimeServicesTableLib, BaseMemoryLib, MemoryAllocationLib

## Platform

x86-64, PE32+, UEFI DXE driver, 6 sections (.text/.rdata/.data/section_3/.xdata/.reloc), entry at 0x390