The Full Wiki

Linux console: Wikis

Advertisements

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

From Wikipedia, the free encyclopedia

The Linux console is a system console support in the Linux kernel. The Linux console was the first functionality of the Linux, developed as early as in 1991 (see history of Linux). On PC architecture it is common to use a VGA-compatible video hardware. Implementations of computer graphics on Linux are excluded from the scope of this article. Linux console, like pure text mode, uses monospace fonts.

Contents

Purpose

The Linux console is intended to run usual text user interface applications, and also to show some kernel messages (considered as urgent or important).

VGA/keyboard implementation of the console

Advertisements

Font, character set and keyboard layout

The text buffer is a part of VGA memory which describes the content of a text screen in terms of code points and character attributes. Code points in the text buffer and font are generally not the same as encoding used in text terminal semantics to put characters on the screen. The set of glyphs on the screen is determined by the current font. The text screen is handled by console.c and consolemap.c drivers. An utility for altering fonts and terminal encodings is called consolechars.

Linux kernel (keyboard.c driver) also have an almost complete support of keyboard input (keyboard layouts), but it remains a bit inconsistent because interacts badly with different character sets. Layouts are loaded by loadkeys utility.

These two utilities and corresponding data files are packed in Linux Console Tools http://lct.sourceforge.net/ shipped with many Linux distributions.

Efforts on the internationalization of Linux at the kernel level started as early as in 1994 by Markus Kuhn and Andries Brouwer.

Virtual consoles

Virtual consoles allows to store multiple text buffers, allowing different console programs to run simultaneously but interact with user separately (which user’s ability to switch between applications). This creates an illusion of several independent consoles.

Each virtual console can have its own character set and keyboard layout. On Linux 2.6 became possible even to load different font for each virtual console (kernels before 2.6 change the font only by demand).

Text modes

Linux console is capable to support any VGA-style text mode, but the kernel itself has very limited means to set these modes up. SVGATextMode helps to set up better looking text modes than EGA and VGA standard ones. It is fully compatible with Console Tools, but have some conflicts with dosemu, SVGAlib and X servers.

It is (yet) impossible to have different modes on different virtual consoles.

Comparison to Windows and DOS

Microsoft Windows (of any version) does not have a fully functional support of the console. The comparable feature there, but for application software only, is the Win32 console.

Feature Linux Windows DOS
VGA text attributes Yes Yes Yes
Custom fonts Possible Possible Possible
Character set 512 glyphs max. (on VGA text),
any code page or UTF-8
223 or 256 characters (depends on access method), any code page, no Unicode *
Run-time character set switching Possible ** Impossible * depends on PoV
Terminal emulation Yes, ANSI-compatible
(TERM=linux)
No Yes, ANSI
(with ANSI.SYS)
Run-time switching between text mode and GUI technically possible, but usually impractical Possible application dependent
Run-time changing numbers of rows and columns Possible Possible application dependent
Switching between applications Possible Possible Limited
(some TSRs may be activated)
Non-standard modes Possible Impossible Possible
Mouse support Yes
(with gpm or so)
application dependent system and application dependent

 * – as for Windows 9x. Windows NT based systems allow to switch code pages and use Unicode, but only in window mode. Also, NT systems use own text buffer format incompatible with VGA, which produces an overhead in hardware text modes.
 ** – a non-ASCII keyboard layout should be reloaded because of flawed implementation.

Linux framebuffer

The Linux framebuffer (fbdev) is a graphic hardware-independent abstraction layer, which was originally implemented to allow the Linux kernel to emulate a text console on systems such as the Apple Macintosh that do not have a text-mode display. Now it offers a kernel space text mode emulation on any platform. Its advantage over (currently unmaintained) SVGATextMode is a reliance and better hardware compatibility. It also permits to overpass all technical restrictions of VGA text modes.

A Linux framebuffer console differs from a VGA one only in ways of drawing characters. The processing of keyboard events and virtual consoles’ support are exactly the same.

Unusual implementations

Linux serial console is a console implementation via serial port. It may be used in some embedded systems, and on servers, where a direct interaction with operator is not expected. The serial console allows the same mode of access for the system, but usually at a slower speed due to the small bandwidth of RS-232.

There is also a console implementation via Bluetooth.

List of /dev/ entries related to the console

Name Major Minor Description
/dev/tty1

/dev/tty63
c   4 1

63
virtual consoles
(keyboard controlled)
/dev/vcs1

/dev/vcs63
c   7 1

63
The text (the character pointer table) of a virtual screen
/dev/vcsa1

/dev/vcsa63
c   7 129

191
Full image of a virtual text buffer; first 4 bytes contain numbers of rows, columns and cursor position
/dev/ttyS0
c   4 64
Serial ports, suitable for system console
/dev/tty0 c   4 0 “current console”

See also


Advertisements






Got something to say? Make a comment.
Your name
Your email address
Message