ArticleslgStudy

science

VGA text mode

VGA text mode is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand VGA text mode rather than just read about it. In short: VGA text mode was introduced in 1987 by IBM as part of the VGA display 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.

VGA text mode — main illustration
VGA text mode — illustration

Key takeaways

  • VGA text mode belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect VGA text mode to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of VGA text mode from memory before moving on to harder problems.

Reference excerpt

VGA text mode was introduced in 1987 by IBM as part of the VGA display 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 (programmable 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 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. 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 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. If the underline location is set to a visible scanline (as it is by default when switching to an MDA-compatible monochrome text mode), then the underline will appear.

Fonts

Screen fonts used in EGA and VGA are monospace raster fonts containing 256 glyphs, and 2 fonts may be used simultaneously, for a total of 512 glyphs. All glyphs on screen are the same size, but that size is variable. Typically, glyphs are 8 dots wide and 8–16 dots high, however the height can be any value up to a maximum of 32. Each row of a glyph is coded in an 8-bit byte, with high bits to the left of the glyph and low bits to the right. Along with several hardware-dependent fonts stored in the adapter's ROM, the text mode offers 8 loadable fonts. Two active font pointers (font A and font B) select two of the available fonts, although they usually point to the same font. When they each point to different fonts, attribute bit 3 (see above) acts as a font selection bit instead of as a foreground color bit. On real VGA hardware, this overrides the bit's use for color selection, but on many clones and emulators, the color selection remains – meaning one font is displayed as normal intensity, and the other as high-intensity. This difference (and incompatibility) can be overcome by changing the palette registers to contain two copies of an 8-color palette. A VGA-capable video card must implement ASCII characters in its Video BIOS; VGA text fonts of other European languages, such as German and Russian, may be defined in other code pages. There are modes with a character box width of 9 dots (e.g. the default 80×25 mode), however the 9th column is used for spacing between characters, so the content cannot be changed. It is always blank, and drawn with the current background color. An exception to this is in Line Graphics Enable mode, which causes code points 0xC0 to 0xDF inclusive to have the 8th column repeated as the 9th. These code points cover those box-drawing characters which must extend all the way to the right side of the glyph box. For this reason, placing letter-like characters in code points 0xC0–0xDF should be avoided. The box-drawing characters from 0xB0 to 0xBF are not extended, as they do not point to the right and so do not require extending.

Cursor

The shape of the cursor is restricted to a rectangle the full width of the character box, and filled with the foreground color of the character at the cursor's current location. Its height and position may be set to anywhere within a character box;. 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. The VGA standard does not provide a way to alter the blink rate, although common workarounds involve hiding the cursor and using a normal character glyph to provide a so-called software cursor. A mouse cursor in TUI (when implemented) is not usually the same thing as a hardware cursor, but a moving rectangle with altered background or a special glyph. Some text-based interfaces, such as that of Impulse Tracker, went to even greater lengths to provide a smoother and more graphic-looking mouse cursor. This was done by constantly re-generating character glyphs in real-time according to the cursor's on-screen position.

BIOS Color Attribute

… excerpt ends here. Continue reading the full article.

Illustrations

VGA text mode illustration
VGA text mode: VGA shows us the code page 737 with Greek letters
VGA shows us the code page 737 with Greek letters
VGA text mode: Mouse cursor in Impulse Tracker
Mouse cursor in Impulse Tracker

Worked examples

Example 1 — a first encounter with VGA text mode

Start with the simplest possible case. Write down what VGA text mode claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to VGA text mode before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about VGA text mode ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of VGA text mode

In research
VGA text mode appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses VGA text mode in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
VGA text mode is common in secondary-school and first-year university syllabi. It links to neighbouring topics DOS on IBM PC compatibles, IBM PC compatibles, Text user interface, so understanding it makes those chapters shorter.
In everyday life
Look for VGA text mode outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “VGA text mode” →

How to study VGA text mode in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what VGA text mode means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain VGA text mode out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is VGA text mode in simple terms?

VGA text mode was introduced in 1987 by IBM as part of the VGA display 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.

Why does VGA text mode matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study VGA text mode?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on VGA text mode.

Tags

  • DOS on IBM PC compatibles
  • IBM PC compatibles
  • Text user interface

Keep exploring