Which library/code is responsible for rendering the terminal in retro computers?

150 views Asked by At

For example as you type, which library is telling the computer screen to display the respective ascii character and to move the cursor accordingly?

Imagine something like the old school computers (with no GUI) running DOS or Basic... what/which library is responsible for the UI?

Links to source code would be great for understanding how said library(ies) works.

enter image description here

3

There are 3 answers

2
Nathanael McDaniel On

If you're interested in seeing the internals of a terminal to better understand how it works and renders input/output, Bash is completely open source. You can download its latest source code here.

0
Ben Hillier On

The photo you have posted is of a BBC Micro running in Mode 7. This was an exception to most rules. Mode 7 was a low memory mode, in which there where no pixels, just 256 text characters. 1K of memory was reserved in RAM to contain what was displayed on the screen at that moment. A special chip on the circuit board, called the Video ULA (Uncommited Logic Array) read the contents of that memory and coded it to the output. The ULA was ROM and could not be changed by the programmer.

The ZX81 worked in a similar way: 256 possible text characters and no pixels. However the ZX81 had less dedicated chips and the main CPU did most of the work.

A more common setup was that every pixel was represented by a number of bits in memory (often more than one bit per pixel was needed because colours had to be indicated). Examples are BBC in modes 1-6; the Acorn Electron; Spectrum; C64; also many others. When the user placed text on the screen, the computers ROM would convert this to the correct pixels. Graphics could often be written directly to the RAM, or 'plotted' via BASIC. Once again, dedicated ROM chips and circuitry would then render this memory to the output. This approach required much more memory to display.

Every 8 bit computer had its own way of representing the display in RAM. You need to get manuals of the machine you are trying to program (easy to find on internet for the better known Micros).

Many emulators are open source, if you want to see the internals. For example: https://github.com/stardot/beebem

0
Richard Broadhurst On

The BBC Micro MODE 7 described above was unique afaik as it used an actual TeleText (SAA5050 iirc) chip as found in TVs which allowed a nicer font than the usual 8x8 pixels, colour, block (2x3) graphics as well as effects like flashing and hiding parts of the text that could be revealed by changing a single character. This was almost certainly a requirement of the British Broadcasting Corporation who were sponsoring along with the government a country wide Computer Literacy Project https://clp.bbcrewind.co.uk/