Linux console
Encyclopedia
The Linux console is a system console
System console
The system console, root console or simply console is the text entry and display device for system administration messages, particularly those from the BIOS or boot loader, the kernel, from the init system and from the system logger...

 support in the Linux kernel
Linux kernel
The Linux kernel is an operating system kernel used by the Linux family of Unix-like operating systems. It is one of the most prominent examples of free and open source software....

. The Linux console was the first functionality of the kernel, developed as early as in 1991 (see history of Linux
History of Linux
The History of Linux began in 1991 with the commencement of a personal project by a Finnish student, Linus Torvalds, to create a new operating system kernel.Since then the resulting Linux kernel has been marked by constant growth throughout its history...

). On PC architecture, it is common to use VGA
Video Graphics Array
Video Graphics Array refers specifically to the display hardware first introduced with the IBM PS/2 line of computers in 1987, but through its widespread adoption has also come to mean either an analog computer display standard, the 15-pin D-subminiature VGA connector or the 640×480 resolution...

-compatible video hardware. Implementations of computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

 on Linux are excluded from the scope of this article. Linux console, like pure text mode, uses monospace font
Monospace font
A monospaced font, also called a fixed-pitch or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space...

s.

Purpose

The Linux console is intended to run usual text user interface
Text user interface
TUI short for: Text User Interface or Textual User Interface , is a retronym that was coined sometime after the invention of graphical user interfaces, to distinguish them from text-based user interfaces...

 applications, and also to show some kernel messages (considered as urgent or important).

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 point
Code point
In character encoding terminology, a code point or code position is any of the numerical values that make up the code space . For example, ASCII comprises 128 code points in the range 0hex to 7Fhex, Extended ASCII comprises 256 code points in the range 0hex to FFhex, and Unicode comprises 1,114,112...

s and character attributes. Code points in the text buffer and font are generally not the same as encoding
Character encoding
A character encoding system consists of a code that pairs each character from a given repertoire with something else, such as a sequence of natural numbers, octets or electrical pulses, in order to facilitate the transmission of data through telecommunication networks or storage of text in...

 used in text terminal semantics to put characters on the screen. The set of glyph
Glyph
A glyph is an element of writing: an individual mark on a written medium that contributes to the meaning of what is written. A glyph is made up of one or more graphemes....

s on the screen is determined by the current font. The text screen is handled by console.c and consolemap.c drivers. There is a utility for altering fonts and terminal encodings called consolechars.

The Linux kernel (keyboard.c driver) has almost complete support for keyboard input (keyboard layout
Keyboard layout
A keyboard layout is any specific mechanical, visual, or functional arrangement of the keys, legends, or key–meaning associations of a computer, typewriter, or other typographic keyboard....

s), but it remains a bit inconsistent because it interacts badly with different character sets. Layouts are loaded by the loadkeys utility.

These two utilities and corresponding data files are packed in Linux Console Tools http://lct.sourceforge.net/ shipped with many Linux distribution
Linux distribution
A Linux distribution is a member of the family of Unix-like operating systems built on top of the Linux kernel. Such distributions are operating systems including a large collection of software applications such as word processors, spreadsheets, media players, and database applications...

s.

Efforts on the internationalization
Internationalization
In economics, internationalization has been viewed as a process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization or international entrepreneurship...

 of Linux at the kernel level started as early as in 1994 by Markus Kuhn
Markus Kuhn
Markus G. Kuhn is a German computer scientist, currently teaching and researching at the University of Cambridge Computer Laboratory. A graduate of the University of Erlangen , he received his MSc at Purdue University and PhD at the University of Cambridge...

 and Andries Brouwer
Andries Brouwer
Andries Evert Brouwer is a Dutch mathematician and computer programmer, a professor at Eindhoven University of Technology . His varied research interests include several branches of discrete mathematics, particularly graph theory and coding theory...

.

Virtual consoles

Virtual consoles allow the storage of multiple text buffers, enabling different console programs to run simultaneously but interact with the user in different contexts. From the user's point of view, this creates the illusion of several independent consoles.

Each virtual console can have its own character set and keyboard layout.
Linux 2.6 introduced the ability to load a different font for each virtual console (kernel versions predating 2.6 change the font only on demand).

Text modes

The Linux console is capable of supporting any VGA-style text mode, but the kernel itself has very limited means to set these modes up. SVGATextMode helps to enable more complex text modes than the standard EGA and VGA modes. It is fully compatible with Console Tools, but has some conflicts with dosemu
DOSEMU
DOSEMU, alternatively rendered dosemu, is a compatibility layer software package that enables MS-DOS systems, DOS clones such as FreeDOS, and DOS software to run under Linux on x86-based PCs ....

, SVGAlib
SVGALib
SVGAlib is an open-source low-level graphics library which runs on Linux and FreeBSD and allows programs to change video mode and display full-screen graphics. Some popular games like Quake and Doom used it in their original releases....

 and X servers.

Currently, there is no support for different modes on different virtual consoles.

Comparison to Windows and DOS

Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

 (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
Win32 console
Win32 console is a text user interface implementation within the system of Windows API, which runs console applications. A Win32 console has a screen buffer and an input buffer, and is available both as a window or in text mode screen, with switching back and forth available via Alt-Enter...

. !Feature
!Linux
!Windows
!DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...


|-
|VGA text attributes
| bgcolor=#66FF66 |Yes
| bgcolor=#66FF66 |Yes
| bgcolor=#66FF66 |Yes
|-
|Custom fonts
| bgcolor=#66FF66 |Possible
| bgcolor=#66FF66 |Possible
| bgcolor=#66FF66 |Possible
|-
|Character set
|512
512 (number)
512 is the natural number following 511 and preceding 513.512 is a power of two: 29 and the cube of 8: 83.Also, it is the eleventh Leyland number.- Special use in computers :...

 glyphs max. (on VGA text),
any code page or UTF-8
UTF-8
UTF-8 is a multibyte character encoding for Unicode. Like UTF-16 and UTF-32, UTF-8 can represent every character in the Unicode character set. Unlike them, it is backward-compatible with ASCII and avoids the complications of endianness and byte order marks...


| colspan=2 |223
223 (number)
223 is the natural number between 222 and 224. It is also a prime number.-In mathematics:223 is a long prime, a strong prime, a lucky prime and a sexy prime .223 is the fourth Carol number and the third to be prime....

 or 256
256 (number)
256 is the natural number following 255 and preceding 257.-In mathematics:256 is a composite number, with the factorization 256 = 28, which makes it a power of two....

 characters (depends on access method), any code page
Code page
Code page is another term for character encoding. It consists of a table of values that describes the character set for a particular language. The term code page originated from IBM's EBCDIC-based mainframe systems, but many vendors use this term including Microsoft, SAP, and Oracle Corporation...

, no Unicode *
|-
|Run-time character set switching
| bgcolor=#99FF66 |Possible **
| bgcolor=#FF9999 |Impossible *
|depends on PoV
|-
|Terminal emulation
| bgcolor=#66FF66 |Yes, ANSI
ANSI art
ANSI art is a computer art form that was widely used at one time on BBSes. It is similar to ASCII art, but constructed from a larger set of 256 letters, numbers, and symbols — all codes found in IBM code page 437, often referred to as extended ASCII and used in MS-DOS and Unix environments...

-compatible
(TERM
Terminfo
Terminfo is a library and database that enables programs to use display terminals in a device-independent manner. This library has its origins in the UNIX System III operating system....

=linux)
| bgcolor=#FF6666 |No
| bgcolor=#66FF66 |Yes, ANSI
(with ANSI.SYS
ANSI.SYS
ANSI.SYS is a device driver in the DOS operating system that provides extra console functions through ANSI escape sequences. It is partially based upon a subset of the text terminal control standard proposed by the ANSI X3L2 Technical Committee on Codes and Character Sets .-Usage:To use ANSI.SYS...

)

|-
|Run-time switching between text mode and GUI
| bgcolor=#FFFF66 |technically possible, but usually impractical
| bgcolor=#66FF66 |Possible
| bgcolor=#FFFF66 |application dependent
|-
|Run-time changing numbers of rows and columns
| bgcolor=#66FF66 |Possible
| bgcolor=#66FF66 |Possible
| bgcolor=#FFFF66 |application dependent
|-
|Switching between applications
| bgcolor=#66FF66 |Possible
| bgcolor=#66FF66 |Possible
| bgcolor=#FFFF66 |Limited
(some TSRs
Terminate and Stay Resident
Terminate and Stay Resident is a computer system call in DOS computer operating systems that returns control to the system as if the program has quit, but keeps the program in memory...

 may be activated)
|-
|Non-standard modes
| bgcolor=#66FF66 |Possible
| bgcolor=#FF6666 |Impossible
| bgcolor=#66FF66 |Possible
|-
|Mouse support
| bgcolor=#66FF66 |Yes
(with gpm
GPM (software)
GPM which means "general purpose mouse" provides mouse support in Linux virtual consoles. It is included in most Linux distributions.ncurses supports GPM; many applications use ncurses mouse-support....

 or so)
| bgcolor=#FFFF66 |application dependent
| bgcolor=#FFFF66 |system and application dependent
|}>
 * – as for Windows 9x
Windows 9x
Windows 9x is a generic term referring to a series of Microsoft Windows computer operating systems produced since 1995, which were based on the original and later modified Windows 95 kernel...

. Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

 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
Serial port
In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time...

. It may be used in some embedded system
Embedded system
An embedded system is a computer system designed for specific control functions within a larger system. often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal...

s, and on servers, where a direct interaction with operator
Computer operator
A role within IT, computer operators oversee the running of computer systems, ensuring that the machines are running and physically secured. The traditional role of a computer operator was to work with mainframes which required a great deal of management day-to-day, however nowaday they often work...

 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
RS-232
In telecommunications, RS-232 is the traditional name for a series of standards for serial binary single-ended data and control signals connecting between a DTE and a DCE . It is commonly used in computer serial ports...

.

There is also a console implementation via Bluetooth
Bluetooth
Bluetooth is a proprietary open wireless technology standard for exchanging data over short distances from fixed and mobile devices, creating personal area networks with high levels of security...

.

List of /dev/ entries related to the console

!Name
!Major
!Minor
!Description
|-
|/dev/tty1

/dev/tty63
| align=right |c   4
| align=right |1

63
| virtual consoles
(keyboard controlled)
|-
|/dev/vcs1

/dev/vcs63
| align=right |c   7
| align=right |1

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

/dev/vcsa63
| align=right |c   7
| align=right |129

191
| Full image of a virtual text buffer; first 4 bytes contain numbers of rows, columns and cursor
Cursor (computers)
In computing, a cursor is an indicator used to show the position on a computer monitor or other display device that will respond to input from a text input or pointing device. The flashing text cursor may be referred to as a caret in some cases...

 position
|-
|/dev/ttyS0

| align=right |c   4
| align=right |64

| Serial port
Serial port
In computing, a serial port is a serial communication physical interface through which information transfers in or out one bit at a time...

s, suitable for system console
|-
|/dev/tty0
| align=right |c   4
| align=right |0
| “current console”
|}>
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK