Text mode
Text mode is a fundamental display mode in computing systems where the screen is organized into a grid of character cells, rendering only alphanumeric text characters from a defined character set, such as ASCII, without support for graphical images or pixel-based visuals.[1][2] This mode, also known as character mode or alphanumeric mode, divides the display into rows and columns of fixed-size boxes, each containing a single character, enabling efficient text-based interaction and output.[2] In contrast to graphics mode, which manipulates individual pixels for images and interfaces, text mode prioritizes simplicity and speed for command-line interfaces (CLI) and early software environments.[1] Historically, text mode was the predominant display method in personal computers before the rise of graphical user interfaces (GUIs) in the 1980s and 1990s, serving as the built-in default for systems lacking dedicated graphics hardware.[1] During this era, it facilitated core operations like booting, command execution, and program interaction on platforms such as MS-DOS and early Unix terminals, where graphics modes were optional extensions requiring additional hardware or software support.[1] Common configurations included 80 columns by 25 rows for standard displays, providing a total of 2,000 character cells, which balanced readability with limited memory resources.[3] Technically, text mode often relies on memory-mapped video buffers, as seen in the Video Graphics Array (VGA) standard, where the display memory starts at physical address 0xb8000 and spans 4,000 bytes to accommodate the 80x25 grid.[3] Each cell is defined by two bytes: the first holding the character's ASCII code, and the second specifying attributes like foreground and background colors (e.g., green text on a black background using values 0x2 for green and 0x0 for black).[3] In contemporary computing, text mode persists in console windows, terminal emulators, and text-only web browsers, where users may disable graphics to accelerate loading or focus on content extraction.[2] It also underpins bootloaders, embedded systems, and server environments that favor lightweight, resource-efficient text rendering over full graphical capabilities.[2]Overview and Fundamentals
Definition and Characteristics
Text mode is a display mode in computing where the screen content is represented as a fixed grid of character cells, commonly organized into 80 columns by 25 rows. Each cell contains a character code that references a predefined pattern stored in a character generator ROM, which converts the code into a dot-matrix bitmap for display; additionally, cells support attributes such as foreground and background colors to enhance readability and visual distinction.[2][4] This approach allows for efficient rendering of textual information without requiring direct pixel manipulation. In contrast to graphics modes, which enable fine-grained control over individual pixels to create images, animations, or vector graphics, text mode restricts output to discrete character cells, making it suitable primarily for alphanumeric content and basic block-based visuals rather than complex illustrations.[5][6] Key characteristics include its fixed resolution grid, which ensures consistent layout across compatible systems, and reliance on standardized character sets such as ASCII for basic Latin letters, digits, and symbols, or IBM Code Page 437 for extended support including line-drawing elements, accented characters, and icons commonly used in early PC environments.[2][7] Text mode plays a foundational role in text user interfaces (TUIs) and command-line environments, where it facilitates direct keyboard input and output for applications like shells, editors, and utilities, prioritizing simplicity and low resource demands over visual sophistication.[6][8]Technical Basis
Text mode operation in early computing systems, particularly IBM PC-compatible architectures, relies on a dual-layer video memory structure to store both character data and display attributes. The character memory holds ASCII or extended codes for each display cell, requiring 2000 bytes for an 80×25 grid configuration. Adjacent to this is the attribute memory, allocating 1 byte per cell to encode visual properties such as colors and special effects like blinking, resulting in a total of 4000 bytes per display page in color adapters. This interleaved format, with character and attribute bytes paired sequentially, is accessed via memory-mapped I/O at addresses like B800:0000 for color text modes or B000:0000 for monochrome.[9][10][11] Central to the display generation is the video controller, such as the Motorola 6845 Cathode Ray Tube Controller (CRTC) used in IBM PC video adapters. The CRTC manages the scanning process by generating memory addresses to fetch character codes from video RAM and corresponding attribute bytes, while synchronizing horizontal and vertical timing signals to traverse the display grid. It coordinates with the character generator circuitry to produce pixel data for each cell, ensuring the raster scan aligns with monitor refresh rates.[12][13] Attributes are processed through a bit-packed byte structure that defines rendering characteristics for each character. In VGA implementations, the attribute byte uses 4 bits for foreground color selection (spanning 16 palette entries), 3 bits for background color (8 entries), and 1 bit for a blinking flag; a global mode in the attribute controller can repurpose the blink bit for intensity, enabling brighter variants of colors 0–7. Underline and other effects are handled via dedicated bits in the attribute controller registers, which modulate the character bitmap during scanline assembly.[14][11] Font rendering draws from raster patterns stored in read-only memory (ROM) on the video adapter, typically 8×8 or 8×14 pixels per glyph to match common scanline counts. For each character cell, the controller indexes the ROM using the fetched code to retrieve an 8-byte (or equivalent) bitmap, then generates individual scanlines by shifting out bits and applying attribute-based coloring or effects before combining them into the video signal.[11][15] The processed pixel data is output as electrical signals tailored to the adapter type: the Monochrome Display Adapter (MDA) emits TTL-level monochrome signals for video presence and intensity, producing green or amber phosphor illumination on compatible CRTs, while the Color Graphics Adapter (CGA) provides TTL RGB signals for direct color display or an NTSC-compatible composite video output for television monitors.[16][17]Historical Development
Origins in Early Computing
The emergence of text mode in early computing can be traced to the 1960s and 1970s, when video display terminals (VDTs) began replacing slower teleprinters for interactive computer access, providing immediate visual feedback on cathode-ray tube (CRT) screens.[18] These VDTs transmitted data using standard protocols like ASCII over serial interfaces, enabling efficient text-based communication between users and mainframe systems.[19] A seminal example is the Digital Equipment Corporation (DEC) VT05, introduced in 1970 as DEC's first standalone raster-scan video terminal, featuring a 20-by-72 character display limited to uppercase ASCII characters and connected via RS-232 serial lines at speeds up to 2400 baud.[20][21] This design marked a shift from mechanical printing to electronic text rendering, laying the groundwork for grid-based displays where characters occupied fixed positions on the screen. Mainframe systems further influenced text mode through terminals optimized for high-volume data processing, such as the IBM 3270 family introduced in 1971.[22] The 3270 employed block-mode operation with fixed character grids—typically 24 rows by 80 columns—allowing users to edit fields locally before transmitting entire screens to the host, which minimized communication overhead and improved efficiency in time-sharing environments.[23] This approach supported attribute concepts like highlighting and protection for data fields, enhancing usability without requiring full-screen redraws.[22] A key innovation enabling widespread adoption was the use of CRT displays paired with dedicated character generators, hardware circuits that converted ASCII codes into dot patterns for predefined glyphs, stored in read-only memory.[24] Unlike vector or bitmap graphics systems, which demanded expensive refresh memory and complex deflection logic for arbitrary images, character generators drastically reduced costs by limiting output to a fixed set of symbols, making text terminals affordable for institutional use at under $2,000 per unit by the mid-1970s.[25] This efficiency prioritized textual information display over graphical versatility, establishing text mode as a practical standard for computing interfaces. The transition to microcomputers extended these principles, as seen in the MITS Altair 8800, released in 1975 as the first commercially successful personal computer kit.[26] Lacking built-in video capabilities, the Altair relied on serial text output to external terminals or teletypes via add-on interface boards, such as RS-232 adapters, for user interaction and program debugging.[27] This setup influenced subsequent designs, paving the way for integrated dedicated video boards that rendered text modes directly on affordable CRT monitors, bridging mainframe terminal technology to personal systems.[28]Evolution in Personal Computers
The introduction of the IBM Personal Computer in 1981 marked a pivotal shift in text mode usage for personal computing, with the Monochrome Display Adapter (MDA) providing an 80x25 character monochrome text display optimized for high-clarity business applications. This adapter, paired with a green- or amber-phosphor monitor, emphasized sharp text rendering without graphics capabilities, reflecting the era's focus on productivity over visual entertainment. In the same year, IBM released the Color Graphics Adapter (CGA), which extended text mode to support color while maintaining compatibility with the MDA's text standards, allowing 80x25 text in 16 colors for broader appeal in home and educational settings. By 1984, the Enhanced Graphics Adapter (EGA) advanced this further, introducing higher-resolution text modes with up to 640x350 resolution and support for 16 simultaneous colors from a palette of 64, enabling finer character definition and smoother display transitions. The 1987 Video Graphics Array (VGA) standard, debuted with the IBM PS/2 line, solidified these improvements by standardizing 16-color text modes using 9x16 pixel fonts, which became the de facto benchmark for PC text rendering across compatible hardware.[29] Standardization accelerated through the BIOS interrupt 10h (INT 10h), an integral part of the original IBM PC firmware that enabled software to switch video modes, query capabilities, and manage text attributes uniformly across adapters from MDA onward.[30] In the 1990s, the Video Electronics Standards Association (VESA) extended this via BIOS Extensions (VBE), adding support for higher-resolution text modes like 132-column displays while preserving backward compatibility with legacy systems.[31] Building on earlier terminal influences, these developments transformed text mode from a basic output mechanism into a versatile, hardware-agnostic interface for PC applications. The rise of graphics acceleration in the mid-1990s, driven by dedicated 2D/3D video cards and graphical user interfaces like Windows 95, diminished reliance on pure text modes for everyday computing, as accelerated rendering favored bitmap graphics over character-based displays. Nonetheless, text modes persisted in bootloaders, DOS environments, and diagnostic tools, ensuring their utility in low-level system operations well into the decade.[29]Features and Capabilities
Benefits and Performance Advantages
Text mode offers significant memory efficiency compared to graphical modes, requiring only 4 KB of video memory for an 80×25 color display, where each character cell uses 2 bytes—one for the ASCII code and one for color attributes—versus 64 KB for a comparable low-resolution graphics framebuffer such as VGA mode 13h (320×200 pixels with 256 colors).[32][33] This compact representation stems from storing symbolic character data rather than pixel bitmaps, allowing the hardware to generate the visual output on demand.[3] In remote access scenarios, text mode provides substantial bandwidth savings by transmitting compact character codes (typically 1 byte per character) along with attribute bytes, in contrast to graphical protocols that send full bitmap data for screen updates.[34] For instance, in Telnet sessions, only textual content and control sequences are exchanged, minimizing data volume and enabling reliable operation over low-bandwidth connections like early dial-up networks.[35] This efficiency is particularly evident when compared to remote desktop protocols such as RDP, where even optimized graphical transmission consumes far more bandwidth for equivalent information display.[34] Processing speed in text mode benefits from dedicated hardware acceleration through components like the Cathode Ray Tube Controller (CRTC), which handles timing, scanning, and synchronization independently of the CPU, thereby reducing the processor's involvement to simple memory writes for character placement.[36] The integrated character generator ROM further offloads pixel pattern creation from software, avoiding the CPU-intensive bitmap rendering required in graphics modes without equivalent hardware support.[3] As a result, text mode operations, such as screen updates or scrolling, impose minimal CPU load, making it suitable for resource-constrained systems where graphics rendering would otherwise bottleneck performance.[36] Text mode's simplicity enhances accessibility in low-resource environments, such as embedded systems or bootloaders, by relying on straightforward memory-mapped I/O without the overhead of graphical APIs or drivers.[37] This design facilitates rapid text processing and output, proving invaluable for debugging, logging, and system monitoring where graphical interfaces would demand excessive resources.[37] Its hardware-direct approach also supports consistent operation across diverse hardware, aiding developers in early-stage software verification without specialized rendering tools.[3]User-Defined Characters and Customization
In VGA text modes, the character set can be redefined by loading custom glyphs into the video RAM, enabling up to 256 user-defined 8x16 pixel characters stored in display memory plane 2.[14] This process overrides the default fonts typically sourced from the VGA ROM, allowing flexible modification without altering hardware firmware.[14] The VGA supports eight 8KB font banks, with each glyph defined by a 32-byte bitmap—eight bits per scan line across 16 lines—aligned on 32-byte boundaries and accessed via standard video memory addressing in read/write mode 0.[14] Redefinition is commonly performed using BIOS interrupt INT 10h (AH=11h, AL=00h), which copies a block of user-supplied font data directly to the character generator tables in video RAM.[38] Key parameters include BH for character height in scan lines (e.g., 16 for standard 8x16 glyphs), BL for the target font block (0-7 on VGA), CX for the number of characters to redefine, DX for the starting ASCII code (0-255), and ES:BP pointing to the font data array (height × CX bytes total).[38] For direct low-level access, programmers can write to the font memory at segment A000h, segment offset calculated as (character code × 32) + (bank × 8192), though this requires precise control of VGA registers like the sequencer for plane selection.[14] In programming environments like BASIC, custom fonts can be loaded via BIOS calls using statements such asCALL INTERRUPT in QBASIC or GW-BASIC to invoke INT 10h, or by POKE commands to directly manipulate video memory addresses for simpler glyph overrides.[39] Dedicated utilities facilitate this process; for instance, TSR programs can upload fonts into RAM at boot, while tools like romfontr allow extraction and replacement of ROM-based fonts by modifying BIOS images and recalculating checksums before reflashing.[40]
These features enable practical applications such as semi-graphics in games, where custom block characters simulate borders, tiles, or simple shapes without switching to full graphics modes—for example, redefining codes 176-223 for filled and outlined blocks akin to extended ASCII line drawing.[14] They also support international symbols by remapping unused codes to glyphs for non-Latin scripts, enhancing text display in DOS applications.[38]
However, customization is hardware-dependent, requiring EGA or VGA-compatible adapters, and demands adjustments to CRTC registers (e.g., maximum scan lines) for proper rendering—failure to do so may cause truncated or corrupted displays.[38] Direct memory writes risk instability if not aligned correctly, potentially leading to garbled text or mode incompatibilities with software expecting standard ROM fonts.[41]
Specific Implementations
Common PC Text Modes
Common text modes on IBM PC-compatible systems were standardized through BIOS interrupts and hardware adapters like the Monochrome Display Adapter (MDA), Color Graphics Adapter (CGA), Enhanced Graphics Adapter (EGA), and Video Graphics Array (VGA), enabling consistent display capabilities across compatible hardware. These modes primarily supported character-based rendering in the video memory segments B000:0000 for monochrome or B800:0000 for color, with each character occupying two bytes: one for the ASCII code and one for attributes such as foreground/background color or intensity.[42][43] Mode 03h, the standard color text mode introduced with the CGA and fully supported by EGA and VGA adapters, operates at 80 columns by 25 rows, rendering a 640x200 pixel display using 8x8 pixel fonts and a palette of 16 colors defined by attribute bytes. This mode allows for programmable character attributes including foreground and background colors from the 16-color set, blinking text, and up to eight display pages for rapid switching in applications. On VGA hardware, it can utilize taller 9x16 fonts for a 720x400 pixel resolution while maintaining the 80x25 character grid, providing sharper text at the cost of vertical spacing.[44][42][43] Mode 07h, the monochrome text mode from the MDA standard and emulated on later adapters like EGA and VGA, also provides 80x25 characters but at a higher 720x350 pixel resolution using 9x14 pixel fonts, with no color support and limited attributes to intensity (normal or highlighted) and underline, excluding text blinking capabilities. This mode prioritizes clarity for text-heavy tasks like word processing, displaying on green- or amber-phosphor monitors without cursor blinking, though a visible cursor is supported via attribute bit manipulation. It uses a fixed 256-character ROM set, non-redefinable on original MDA hardware.[44][42][43] Higher-resolution text modes extended these standards on EGA and VGA. The EGA-supported 80x43 mode achieves denser text display at 640x350 pixels using 8x8 fonts in an interlaced scan, compatible with color monitors and supporting the full 16-color attribute set, though requiring specific adapter configuration for non-standard line counts. Similarly, VGA's 80x50 mode renders 80 columns by 50 rows at 640x400 pixels with 8x8 fonts, enabling more content per screen while retaining 16 colors and attribute features, often set alongside mode 03h for enhanced productivity in text interfaces.[42][43][44] These modes are switched via BIOS interrupt 10h (INT 10h) with function 00h: load AH=00h and AL with the mode number (e.g., 03h or 07h), then execute the interrupt to initialize the video controller and clear the screen. For higher-resolution variants like 80x43 or 80x50, additional calls to INT 10h function 11h load the appropriate 8x8 font set (e.g., AL=12h for EGA 80x43 or AL=14h for VGA 80x50, with BL=00h), followed by setting mode 03h to apply the changes. VGA adapters support the full range of legacy modes from 00h to 13h, including text and mixed text-graphics operations, ensuring backward compatibility.[42][43][44]| Mode | Adapter Support | Character Resolution | Pixel Resolution | Colors/Attributes | Font Size |
|---|---|---|---|---|---|
| 03h | CGA, EGA, VGA | 80x25 | 640x200 (CGA); 720x400 (VGA) | 16 colors, blink | 8x8 (default); 9x16 (VGA) |
| 07h | MDA, EGA, VGA | 80x25 | 720x350 | Monochrome, underline/intensity (no blink) | 9x14 |
| 80x43 | EGA | 80x43 | 640x350 (interlaced) | 16 colors, blink | 8x8 |
| 80x50 | VGA | 80x50 | 640x400 | 16 colors, blink | 8x8 |