Text mode

Last updated

Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of character cells, each of which contains one of the characters of a character set; at the same time, contrasted to graphics mode or other kinds of computer graphics modes.

Contents

Text mode applications communicate with the user by using command-line interfaces and text user interfaces. Many character sets used in text mode applications also contain a limited set of predefined semi-graphical characters usable for drawing boxes and other rudimentary graphics, which can be used to highlight the content or to simulate widget or control interface objects found in GUI programs. A typical example is the IBM code page 437 character set.

An important characteristic of text mode programs is that they assume monospaced fonts, where every character has the same width on screen, which allows them to easily maintain the vertical alignment when displaying semi-graphical characters. This was an analogy of early mechanical printers which had fixed pitch. This way, the output seen on the screen could be sent directly to the printer maintaining the same format.

Depending on the environment, the screen buffer can be directly addressable. Programs that display output on remote video terminals must issue special control sequences to manipulate the screen buffer. The most popular standards for such control sequences are ANSI and VT100.

Programs accessing the screen buffer through control sequences may lose synchronization with the actual display so that many text mode programs have a redisplay everything command, often associated with the Ctrl-L key combination.

History

Text mode video rendering came to prominence in the early 1970s, when video-oriented text terminals started to replace teleprinters in the interactive use of computers.

Benefits

The advantages of text modes as compared to graphics modes include lower memory consumption and faster screen manipulation. [1] At the time text terminals were beginning to replace teleprinters in the 1970s, the extremely high cost of random-access memory in that period made it exorbitantly expensive to install enough memory for a computer to simultaneously store the current value of every pixel on a screen, to form what would now be called a framebuffer. Early framebuffers were standalone devices which cost tens of thousands of dollars, in addition to the expense of the advanced high-resolution displays to which they were connected. [2] For applications that required simple line graphics but for which the expense of a framebuffer could not be justified, vector displays were a popular workaround. But there were many computer applications (e.g., data entry into a database) for which all that was required was the ability to render ordinary text in a quick and cost-effective fashion to a cathode-ray tube.

Text mode avoids the problem of expensive memory by having dedicated display hardware re-render each line of text from characters into pixels with each scan of the screen by the cathode ray. In turn, the display hardware needs only enough memory to store the pixels equivalent to one line of text (or even less) at a time. Thus, the computer's screen buffer only stores and knows about the underlying text characters (hence the name "text mode") and the only location where the actual pixels representing those characters exist as a single unified image is the screen itself, as viewed by the user (thanks to the phenomenon of persistence of vision).

For example, a screen buffer sufficient to hold a standard grid of 80 by 25 characters requires at least 2,000 bytes. [1] Assuming a monochrome display, 8 bits per byte, and a standard size of 8 times 8 bits for each character, a framebuffer large enough to hold every pixel on the resulting screen would require at least 128,000 bits, 16,000 bytes, or just under 16 kilobytes. By the standards of modern computers, these may seem like trivial amounts of memory, but to put them in context, the original Apple II was released in 1977 with only four kilobytes of memory and a price of $1,300 in U.S. dollars (at a time when the minimum wage in the United States was only $2.30 per hour). Furthermore, from a business perspective, the business case for text terminals made no sense unless they could be produced and operated more cheaply than the paper-hungry teleprinters they were supposed to replace.

Another advantage of text mode is that it has relatively low bandwidth requirements in remote terminal use. Thus, a text mode remote terminal can necessarily update the screen much faster than a graphics mode remote terminal linked to the same amount of bandwidth (and in turn will seem more responsive), since the remote server may only need to transmit a few dozen bytes for each screen update in text mode, as opposed to complex raster graphics remote procedure calls that may require the transmission and rendering of entire bitmaps.

User-defined characters

The border between text mode and graphical programs can sometimes be fuzzy, especially on the PC's VGA hardware, because many later text mode programs tried to push the model to the extreme by playing with the video controller. For example, they redefined the character set in order to create custom semi-graphical characters, or even created the appearance of a graphical mouse pointer by redefining the appearance of the characters over which the mouse pointer was shown at a given time.

Text mode rendering with user-defined characters has also been useful for 2D computer and video games because the game screen can be manipulated much faster than with pixel-oriented rendering.

Technical basis

A video controller implementing a text mode usually uses two distinct areas of memory. Character memory or a pattern table contains a raster font in use, where each character is represented by a dot matrix (a matrix of bits), so the character memory could be considered as a three-dimensional bit array. Display matrix (a text buffer, screen buffer, or nametable) tracks which character is in each cell. In the simple case the display matrix can be just a matrix of code points (so named character pointer table), but it usually stores for each character position not only a code, but also attributes.

L\C0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
1
1
0
0
1
0
0
0
0
1
0
1
0
0
1
1
0
0
0
1
1
1
00000000
11111111
00001111
00110011
01010101
11…
00…
00…
00…
01…
00000     
00001    
00010  
00011  
00100  
00101      
00110    
00111        
01000
01001
… … …
Character generator scheme.svg
A sample of character box and corresponding electronic scheme. The glyph is 8×8 pixels, with 3-bit low parts of scan line and dot counter. The screen is between 20×18 and 32×32 character cells, with 5-bit indices.

In the case of raster scan output, which is the most common for computer monitors, the corresponding video signal is made by the character generator, a special electronic unit similar to devices with the same name used in video technology. The video controller has two registers: scan line counter and dot counter, serving as coordinates in the screen dot matrix. Each of them must be divided by corresponding glyph size to obtain an index in the display matrix; the remainder is an index in glyph matrix. If glyph size equals to 2n, then it is possible just to use n low bits of a binary register as an index in glyph matrix, and the rest of bits as an index in the display matrix — see the scheme.

The character memory resides in a read-only memory in some systems. Other systems allow the use of RAM for this purpose, making it possible to redefine the typeface and even the character set for application-specific purposes. The use of RAM-based characters also facilitates some special techniques, such as the implementation of a pixel-graphics frame buffer by reserving some characters for a bitmap and writing pixels directly to their corresponding character memory. In some historical graphics chips, including the TMS9918, the MOS Technology VIC, and the Game Boy graphics hardware, this was actually the canonical way of doing pixel graphics.

Text modes often assign attributes to the displayed characters. For example, the VT100 terminal allows each character to be underlined, brightened, blinking or inverse. Color-supporting devices usually allow the color of each character, and often the background color as well, to be selected from a limited palette of colors. These attributes can either coexist with the character indices or use a different memory area called color memory or attribute memory. [3]

Some text mode implementations also have the concept of line attributes. For example, the VT100-compatible line of text terminals supports the doubling of the width and height of the characters on individual text lines.

PC common text modes

Depending on the graphics adapter used, a variety of text modes are available on IBM PC compatible computers. They are listed on the table below: [4]

Text res.Char. sizeGraphics res.ColorsAdapters
80×259×14720×350B&W Text MDA, Hercules
40×258×8320×20016 colors CGA, EGA
80×258×8640×20016 colorsCGA, EGA
80×258×14640×35016 colors EGA
80×438×8640×35016 colorsEGA
80×259×16720×40016 colors VGA
80×308×16640×48016 colors VGA
80×509×8720×40016 colorsVGA
80×6016 colors VESA-compatible Super VGA
132×2516 colorsVESA-compatible Super VGA
132×4316 colorsVESA-compatible Super VGA
132×5016 colorsVESA-compatible Super VGA
132×6016 colorsVESA-compatible Super VGA

MDA text could be emphasized with bright, underline, reverse and blinking attributes.

Video cards in general are backward compatible, i.e. EGA supports all MDA and CGA modes, VGA supports MDA, CGA and EGA modes.

By far the most common text mode used in DOS environments, and initial Windows consoles, is the default 80 columns by 25 rows, or 80×25, with 16 colors. This mode was available on practically all IBM and compatible personal computers. Several programs, such as terminal emulators, used only 80×24 for the main display and reserved the bottom row for a status bar.

Two other VGA text modes, 80×43 and 80×50, exist but were very rarely used. The 40-column text modes were never very popular outside games and other applications designed for compatibility with television monitors, and were used only for demonstration purposes or with very old hardware.

Character sizes and graphical resolutions for the extended VESA-compatible Super VGA text modes are manufacturer-dependent. Also on these display adapters, available colors can be halved from 16 to 8 when a second customized character set is employed (giving a total repertoire of 512 —instead the common 256— different graphic characters simultaneously displayed on the screen).

Some cards (e.g. S3) supported custom very large text modes, like 100×37 or even 160×120. In Linux systems, a program called SVGATextMode is often used with SVGA cards to set up very large console text modes, such as for use with split-screen terminal multiplexers.

Modern usage

Many modern programs with a graphical interface simulate the display style of text mode programs, notably when it is important to preserve the vertical alignment of text, e.g., during computer programming. There exist also software components to emulate text mode, such as terminal emulators or command line consoles. In Microsoft Windows, the Win32 console usually opens in emulated, graphical window mode. It can be switched to full screen, true text mode and vice versa by pressing the Alt and Enter keys together. [5] This is no longer supported by the WDDM display drivers introduced with Windows Vista. [6]

Linux virtual console operates in text mode. Most Linux distributions support several virtual console screens, accessed by pressing Ctrl, Alt and a function key together.

The AAlib open source library provides programs and routines that specialize in translating standard image and video files, such as PNG and WMV, and displaying them as a collection of ASCII characters. This enables a rudimentary viewing of graphics files on text mode systems, and on text mode web browsers such as Lynx.

See also

Related Research Articles

<span class="mw-page-title-main">IBM 3270</span> Family of block-oriented display terminals and printers made by IBM

The IBM 3270 is a family of block oriented display and printer computer terminals introduced by IBM in 1971 and normally used to communicate with IBM mainframes. The 3270 was the successor to the IBM 2260 display terminal. Due to the text color on the original models, these terminals are informally known as green screen terminals. Unlike a character-oriented terminal, the 3270 minimizes the number of I/O interrupts required by transferring large blocks of data known as data streams, and uses a high speed proprietary communications interface, using coaxial cable.

VESA BIOS Extensions (VBE) is a VESA standard, currently at version 3, that defines the interface that can be used by software to access compliant video boards at high resolutions and bit depths. This is opposed to the "traditional" INT 10h BIOS calls, which are limited to resolutions of 640×480 pixels with 16 colour (4-bit) depth or less. VBE is made available through the video card's BIOS, which installs during boot up some interrupt vectors that point to itself.

<span class="mw-page-title-main">Video Graphics Array</span> Computer display standard and resolution

Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the IBM PC compatible industry within three years. The term can now refer to the computer display standard, the 15-pin D-subminiature VGA connector, or the 640 × 480 resolution characteristic of the VGA hardware.

In computer graphics, planar is the method of arranging pixel data into several bitplanes of RAM. Each bit in a bitplane is related to one pixel on the screen. Unlike packed, high color, or true color graphics, the whole dataset for an individual pixel is not in one specific location in RAM, but spread across the bitplanes that make up the display. Planar arrangement determines how pixel data is laid out in memory, not how the data for a pixel is interpreted; pixel data in a planar arrangement could encode either indexed or direct color.

<span class="mw-page-title-main">Linux framebuffer</span> Abstraction layer for Linux kernel to show graphics on the system console

The Linux framebuffer (fbdev) is a linux subsystem used to show graphics on a computer monitor, typically on the system console.

<span class="mw-page-title-main">Hercules Graphics Card</span> IBM PC graphic adapter and display standard

The Hercules Graphics Card (HGC) is a computer graphics controller formerly made by Hercules Computer Technology, Inc. that combines IBM's text-only MDA display standard with a bitmapped graphics mode, also offering a parallel printer port. This allows the HGC to offer both high-quality text and graphics from a single card.

<span class="mw-page-title-main">Framebuffer</span> Portion of random-access memory containing a bitmap that drives a video display

A framebuffer is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Modern video cards contain framebuffer circuitry in their cores. This circuitry converts an in-memory bitmap into a video signal that can be displayed on a computer monitor.

<span class="mw-page-title-main">Color Graphics Adapter</span> IBM PC graphic adapter and display standard

The Color Graphics Adapter (CGA), originally also called the Color/Graphics Adapter or IBM Color/Graphics Monitor Adapter, introduced in 1981, was IBM's first color graphics card for the IBM PC and established a de facto computer display standard.

<span class="mw-page-title-main">Text-based user interface</span> Type of interface based on outputting to or controlling a text display

In computing, text-based user interfaces (TUI), is a retronym describing a type of user interface (UI) common as an early form of human–computer interaction, before the advent of bitmapped displays and modern conventional graphical user interfaces (GUIs). Like modern GUIs, they can use the entire screen area and may accept mouse and other inputs. They may also use color and often structure the display using box-drawing characters such as ┌ and ╣. The modern context of use is usually a terminal emulator.

<span class="mw-page-title-main">Windows Console</span> Infrastructure for console applications in Microsoft Windows

Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode. The user can switch between the two using the Alt+↵ Enter key combination. The text mode is unavailable in Windows Vista and later. Starting with Windows 10, however, a native full-screen mode is available.

<span class="mw-page-title-main">ANTIC</span> Computer graphics chip

Alphanumeric Television Interface Controller (ANTIC) is an LSI ASIC dedicated to generating 2D computer graphics to be shown on a television screen or computer display. Under the direction of Jay Miner, the chip was designed in 1977–1978 by Joe Decuir, Francois Michel, and Steve Smith for the Atari 8-bit family of home computers first released in 1979 and was patented by Atari, Inc. in 1981. ANTIC is also used in the 1982 Atari 5200 video game console, which shares most of the same hardware as the 8-bit computers.

<span class="mw-page-title-main">CTIA and GTIA</span> Custom chips used in Atari 8-bit computers

Color Television Interface Adaptor (CTIA) and its successor Graphic Television Interface Adaptor (GTIA) are custom chips used in the Atari 8-bit family of computers and in the Atari 5200 home video game console. In these systems, a CTIA or GTIA chip works together with ANTIC to produce the video display. ANTIC generates the playfield graphics while CTIA/GTIA provides the color for the playfield and adds overlay objects known as player/missile graphics (sprites). Under the direction of Jay Miner, the CTIA/GTIA chips were designed by George McLeod with technical assistance of Steve Smith.

<span class="mw-page-title-main">Motorola 6845</span> Display controller

The Motorola 6845, or MC6845, is a display controller that was widely used in 8-bit computers during the 1980s. Originally intended for designs based on the Motorola 6800 CPU and given a related part number, it was more widely used alongside various other processors, and was most commonly found in machines based on the Zilog Z80 and MOS 6502.

In computing, indexed color is a technique to manage digital images' colors in a limited fashion, in order to save computer memory and file storage, while speeding up display refresh and file transfers. It is a form of vector quantization compression.

<span class="mw-page-title-main">Linux console</span> Console of the Linux kernel

The Linux console is a system console internal to the Linux kernel. A system console is the device which receives all kernel messages and warnings and which allows logins in single user mode. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a computer keyboard and reads the output text on a computer monitor. The Linux kernel supports virtual consoles – consoles that are logically separate, but which access the same physical keyboard and display. The Linux console are implemented by the VT subsystem of the Linux kernel, and do not rely on any user space software. This is in contrast to a terminal emulator, which is a user space process that emulates a terminal, and is typically used in a graphical display environment.

<span class="mw-page-title-main">VGA text mode</span> Computer graphics standard from 1987

VGA text mode was introduced in 1987 by IBM as part of the VGA standard for its IBM PS/2 computers. Its use on IBM PC compatibles was widespread through the 1990s and persists today for some applications on modern computers. The main features of VGA text mode are colored characters and their background, blinking, various shapes of the cursor, and loadable fonts. The Linux console traditionally uses hardware VGA text modes, and the Win32 console environment has an ability to switch the screen to text mode for some text window sizes.

<span class="mw-page-title-main">Semigraphics</span> Method used in early text mode video hardware to emulate raster graphics

Text-based semigraphics, pseudographics, or character graphics is a primitive method used in early text mode video hardware to emulate raster graphics without having to implement the logic for such a display mode.

<span class="mw-page-title-main">Tandy Graphics Adapter</span> Computer display standard for the Tandy 1000 series

Tandy Graphics Adapter is a computer display standard for the Tandy 1000 series of IBM PC compatibles, which has compatibility with the video subsystem of the IBM PCjr but became a standard in its own right.

References

  1. 1 2 Bosch, Winn L. (July 1992). "The Perfect PC". PC Magazine. 11 (13): 186. Retrieved 15 December 2015.
  2. Smith, Alvy Ray (2021). A Biography of the Pixel. Cambridge: MIT Press. p. 363. ISBN   9780262365215 . Retrieved 1 October 2022. In this book, Smith recalls that his first framebuffer at the New York Institute of Technology Computer Graphics Lab cost $80,000 in the mid-1970s. It could store a 512 x 512 array of pixels at 256 colors per pixel (that is, 8-bit color depth). Alexander Schure soon bought five more framebuffers for the Lab for $60,000 each. The Lab quickly combined its six framebuffers together, in two groups of three each, to create the first two true 24-bit RGB color framebuffers. Thus, the first had cost $200,000 and the second had cost $180,000; as Smith points out, adjusting for inflation, these numbers add up to roughly $1.7 million in 2021 dollars, which explains why the Lab's researchers were "thrilled" with Schure's generosity.
  3. Text mode layout and palette
  4. Text modes on Ralf Browns interrupt list
  5. Windows uses Alt+Enter to make a terminal full screen
  6. "Some 16-bit DOS-based Programs and the Command Prompt will not run in full-screen mode in Windows Vista and in Windows 7".

Further reading