MarketVGA text mode
Company Profile

VGA text mode

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.

Data arrangement
Text buffer Each screen character is represented by two bytes aligned as a 16-bit word accessible by the CPU in a single operation. The lower (or character) byte is the actual code point for the current character set, and the higher (or attribute) byte is a bit field used to select various video attributes such as color, blinking, character set, and so forth. This byte-pair scheme is among the features that the VGA inherited from the EGA, CGA, and ultimately from the MDA. • Depending on the mode setup, attribute bit 7 may be either the blink bit or the fourth background color bit (which allows all 16 colors to be used as background colors). • Attribute bit 3 (foreground intensity) also selects between fonts A and B (see below). Therefore, if these fonts are not the same, this bit is simultaneously an additional code point bit. • Attribute bit 0 also enables underline, if certain other attribute bits are set to zero (see below). Colors are assigned in the same way as in 4-bit indexed color graphic modes (see VGA color palette). VGA modes have no need for the MDA's reverse and bright attributes because foreground and background colors can be set explicitly. Underline The VGA hardware has the ability to enable an underline on any character that has attribute bit 0 set. However, since this is an MDA-compatible feature, the attribute bits not used by the MDA must be set to zero or the underline will not be shown. With the default VGA palette, setting bit 0 to enable underline will also change the text color to blue. This means text in only two colors can be underlined (5555FF and 0000AA with the default palette). Despite all this, the underline is not normally visible in color modes, as the location of the underline defaults to a scanline below the character glyph, rendering it invisible. The EGA and many VGA clones allowed a split-box cursor (appearing as two rectangles, one at the top of the character box and one at the bottom), by setting the end of the cursor before the start, however if this is done on the original VGA, the cursor is completely hidden instead. == Access methods ==
Access methods
There are generally two ways to access VGA text-mode for an application: through the Video BIOS interface or by directly accessing video RAM Since this address is usually used by 16-bit x86 processes operating in real-mode, it is also the first half of memory segment 0xB800. The text buffer data can be read and written, and bitwise operations can be applied. A part of text buffer memory above the scope of the current mode is accessible, but is not shown. The same physical addresses are used in protected mode. Applications may either have this part of memory mapped to their address space or access it via the operating system. When an application (on a modern multitasking OS) does not have control over the console, it accesses a part of system RAM instead of the actual text buffer. For computers in the 1980s, very fast manipulation of the text buffer, with the hardware generating the individual pixels as fast as they could be displayed, was extremely useful for a fast UI. Even on relatively modern hardware, the overhead of text mode emulation via hardware APA (graphics) modes (in which the program generates individual pixels and stores them into the video buffer) may be noticeable. == Modes and timings ==
Modes and timings
Video signal From the monitor's side, there is no difference in input signal in a text mode and an All Points Addressable (APA) mode of the same size. A text mode signal may have the same timings as VESA standard modes. The same registers are used on adapter's side to set up these parameters in a text mode as in APA modes. The text mode output signal is essentially the same as in graphic modes, but its source is a text buffer and character generator, not a framebuffer as in APA. 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: VGA and compatible cards support MDA, CGA and EGA modes. All colored modes have the same design of text attributes. MDA modes have some specific features (see above) – a text could be emphasized with bright, underline, reverse and blinking attributes. 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 and 8×16 pixels large characters. VGA cards always have a built-in font of this size whereas other sizes may require downloading a differently sized font. This mode was available on practically all IBM and compatible personal computers. Linux kernel 2.6 and later assumes that modes from 0000h to 00FFh represent standard modes if the VGA BIOS supports those, and that modes from 0100h to 07FFh represent VESA modes if the VESA BIOS supports them. Modes from 0900h to 09FFh are Video7 special modes (usually 0940h=80×43, 0941h=132×25, 0942h=132×44, 0943h=80×60, 0944h=100×60, 0945h=132×28 for the typical Video7 BIOS). Linux 2.x allows to check supported video resolutions by passing the argument "vga=ask". Later versions of Linux allow to specify the resolution using modes from 1000h to 7FFFh. The code has a "0xHHWW" form where HH is a number of rows and WW is a number of columns. E.g. 0x1950 corresponds to an 80×25 mode, 0x2b84 to 132×43, etc.) Two other VGA text modes, 80×43 and 80×50, exist but are less common. Windows NT 4.0 displayed its system messages during the boot process in 80×50 text mode. Character sizes and graphical resolutions for the extended VESA-compatible Super VGA text modes are manufacturer-dependent. Some cards, e.g. S3, supported some very large custom text modes, like 132×43 and 132×25. Some graphic adapters of the 2000s were capable of setting up an arbitrarily-sized text mode (in reasonable limits) instead of choosing its parameters from some list. SVGATextMode On Linux and DOS systems with so-named SVGA cards, a program called SVGATextMode can be used to set up better looking text modes than EGA and VGA standard ones. This is particularly useful for large (≥ 17") monitors, where the normal 80×25 VGA text mode's 720×400 pixel resolution is far lower than a typical graphics mode would be. SVGATextMode allows setting of the pixel clock and higher refresh rate, larger font size, cursor size, etc., and allows a better use of the potential of a video card and monitor. In non-Windows systems, the use of SVGATextMode (or alternative options such as the Linux framebuffer) to obtain a sharp text is critical for LCD monitors of 1280×1024 (or higher resolution) because none of the standard text mode resolutions fits this matrix size exactly (and there would be upscaling artifacts). SVGATextMode also allows a fine tuning of video signal timings. Despite the name of this program, only a few of its supported modes conform to SVGA (i.e. VESA) standards. == General restrictions ==
General restrictions
VGA text mode has some hardware-imposed limitations. Because these are too restrictive for modern (post 2000) applications, the hardware text mode on VGA compatible video adapters only has a limited use. • 8 colors may be used by font A and other 8 colors by font B; so, if font A ≠ font B (512 characters mode), then the palette should be halved and a text may effectively use only 8 colors. • Normally, first 8 colors of the same palette. If blink is disabled, then all 16 colors are available for background. For this reason, most modern UEFI boot loaders choose not to utilise VGA text mode; UEFI and any operating systems designed for it tend to use the Graphics Output Protocol (GOP) instead. In order to display text, modern boot loaders and operating systems that utilise GOP use UEFI Simple Text Output Protocol and UEFI Simple Font Protocol. == See also ==
tickerdossier.comtickerdossier.substack.com