*** Welcome to piglix ***

VGA compatible text mode


The implementation of computer monitor text mode on VGA-compatible hardware is quite complex. Its use on PC-compatible computers was widespread in 1980s–1990s (particularly under DOS systems), but persists today for some applications even on modern desktop computers. The main features of VGA text mode are colored (arbitrary 16 color palette) characters and their background, blinking, various shapes of the cursor (block/underline/hidden static/blinking), and loadable fonts (with various glyph sizes). The Linux console traditionally uses hardware VGA-compatible text modes, and the Win32 console environment has an ability to switch the screen to text mode for some text window sizes.

  Distinctive features of VGA text as it commonly used:

  Light gray background (normally not white).

Various
back-/foreground
combinations.

Each screen character is actually 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.

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

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. This means that only bits 3 (intensity) and 7 (blink) can be set concurrently with bit 0 (underline). With the default VGA palette, setting bit 0 to enable underline will also change the text colour to blue. This means text in only two colors can be underlined (light blue and dark blue with the default palette).


...
Wikipedia

...