Linux console
   HOME

TheInfoList



OR:

The Linux console is a
system console One meaning of system console, computer console, root console, operator's 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 ...
internal to the Linux kernel. A system console is the device which receives all kernel messages and warnings and which allows logins in single user mode. The Linux console provides a way for the kernel and other processes to send text output to the user, and to receive text input from the user. The user typically enters text with a
computer keyboard A computer keyboard is a peripheral input device modeled after the typewriter keyboard which uses an arrangement of buttons or keys to act as mechanical levers or electronic switches. Replacing early punched cards and paper tape technolog ...
and reads the output text on a computer monitor. The Linux kernel supports
virtual console A virtual console (VC) – also known as a virtual terminal (VT) – is a conceptual combination of the keyboard and display for a computer user interface. It is a feature of some Unix-like operating systems such as Linux, BSD, illumos, Uni ...
s – consoles that are logically separate, but which access the same physical keyboard and display. The Linux console (and Linux virtual consoles) are implemented by the VT subsystem of the Linux kernel, and do not rely on any
user space A modern computer operating system usually segregates virtual memory into user space and kernel space. Primarily, this separation serves to provide memory protection and hardware protection from malicious or errant software behaviour. Kernel ...
software. This is in contrast to a
terminal emulator A terminal emulator, or terminal application, is a computer program that emulates a video terminal within some other display architecture. Though typically synonymous with a shell or text terminal, the term ''terminal'' covers all remote term ...
, which is a user space process that emulates a terminal, and is typically used in a graphical display environment. The Linux console was one of the first features of the kernel and was originally written by
Linus Torvalds Linus Benedict Torvalds ( , ; born 28 December 1969) is a Finnish software engineer who is the creator and, historically, the lead developer of the Linux kernel, used by Linux distributions and other operating systems such as Android. He also ...
in 1991 (see history of Linux). There are two main implementations:
framebuffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
and
text mode Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of ''character cells'', each ...
. The framebuffer implementation is the default in modern Linux distributions, and together with kernel mode setting, provides kernel-level support for display hardware and features such as showing graphics while the system is booting. The legacy text mode implementation was used in PC-compatible systems with CGA, EGA, MDA and VGA graphics cards. Non-
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was intr ...
architectures used framebuffer mode because their graphics cards did not implement text mode. The Linux console uses fixed-size
bitmap In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array or bitmap index. As a noun, the term "bitmap" is very often used to refer to a particular bitmapping application: t ...
,
monospace font A monospaced font, also called a fixed-pitch, fixed-width, or non-proportional font, is a font whose letters and characters each occupy the same amount of horizontal space. This contrasts with variable-width fonts, where the letters and spaci ...
s, usually defaulting to 8x16 pixels per character. The Linux console is an optional kernel feature, and most
embedded Linux Operating systems based on the Linux kernel are used in embedded systems such as consumer electronics (eg. set-top box A set-top box (STB), also colloquially known as a cable box and historically television decoder, is an information applianc ...
systems do not enable it. These systems typically provide an alternative user interface (e.g. web based), or boot immediately into a
graphical user interface The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inst ...
and use this as the primary means of interacting with the user. Other implementations of the Linux console include the
Braille Braille (Pronounced: ) is a tactile writing system used by people who are visually impaired, including people who are blind, deafblind or who have low vision. It can be read either on embossed paper or by using refreshable braille disp ...
console to support
refreshable Braille display A refreshable braille display or braille terminal is an electro-mechanical device for displaying braille characters, usually by means of round-tipped pins raised through holes in a flat surface. Visually impaired computer users who cannot use a s ...
s and the
serial port In computing, a serial port is a serial communication interface through which information transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which communicates multiple bits simultaneously in parallel. ...
console.


Purpose

The Linux console provides a way for the kernel and other processes to output text-based messages to the user, and to receive text-based input from the user. In Linux, several devices can be used as system console: a virtual terminal, serial port, USB serial port, VGA in text-mode, framebuffer. Some modern Linux-based systems have deprecated kernel based text-mode input and output, and instead show a graphical logo or while the system is booting, followed by the immediate start of a graphical user interface (e.g. the
X.Org Server X.Org Server is the free and open-source implementation of the X Window System display server stewarded by the X.Org Foundation. Implementations of the client-side X Window System protocol exist in the form of ''X11 libraries'', which serve a ...
on desktop distributions, or SurfaceFlinger on Android). During kernel boot, the console is commonly used to display the boot log of the kernel. The boot log includes information about detected hardware, and updates on the status of the boot procedure. At this point in time, the kernel is the only software running, and hence logging via user-space (e.g.
syslog In computing, syslog is a standard for message logging. It allows separation of the software that generates messages, the system that stores them, and the software that reports and analyzes them. Each message is labeled with a facility code, i ...
) is not possible, so the console provides a convenient place to output this information. Once the kernel has finished booting, it runs the init process (also sending output to the console), which handles booting of the rest of the system including starting any background daemons. After the ''init'' boot process is complete, the console will be used to multiplex multiple
virtual terminal In open systems, a virtual terminal (VT) is an application service that: # Allows host terminals on a multi-user network to interact with other hosts regardless of terminal type and characteristics, # Allows remote log-on by local area network ...
s (accessible by pressing Ctrl-Alt-F1, Ctrl-Alt-F2 etc., Ctrl-Alt-LeftArrow, Ctrl-Alt-RightArrow, or using ''chvt''). On each ''virtual terminal'', a getty process is run, which in turn runs ''/bin/login'' to authenticate a user. After authentication, a
command shell In computing, a shell is a computer program that exposes an operating system's services to a human user or other programs. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending ...
will be run. Virtual terminals, like the console, are supported at the Linux kernel level. The Linux console implements a terminal type of "linux" and the escape sequences it uses are in the ''console_codes''
man page A man page (short for manual page) is a form of software documentation usually found on a Unix or Unix-like operating system. Topics covered include computer programs (including library and system calls), formal standards and conventions, and e ...
.


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 mode console

The
text mode Text mode is a computer display mode in which content is internally represented on a computer screen in terms of characters rather than individual pixels. Typically, the screen consists of a uniform rectangular grid of ''character cells'', each ...
implementation is used on PC-based systems with a legacy CGA/EGA/MDA/VGA video card that implements text-based video modes. In text mode, the kernel sends a 2D array of characters to the video card, and the video card converts the characters to pixels for display.


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 In character encoding terminology, a code point, codepoint or code position is a numerical value that maps to a specific character. Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—but ...
s and character attributes. Code points in the text buffer and font are generally not the same as
encoding In communications and information processing, code is a system of rules to convert information—such as a letter, word, sound, image, or gesture—into another form, sometimes shortened or secret, for communication through a communication ...
used in
text terminal A computer terminal is an electronic or electromechanical hardware device that can be used for entering data into, and transcribing data from, a computer or a computing system. The teletype was an example of an early-day hard-copy terminal and ...
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 and drivers. There is a utility for altering fonts and terminal encodings called . The Linux kernel ( driver) has almost complete support for keyboard input (
keyboard layout A keyboard layout is any specific physical, visual or functional arrangement of the keys, legends, or key-meaning associations (respectively) of a computer keyboard, mobile phone, or other computer-controlled typographic keyboard. is the actua ...
s), but it remains a bit inconsistent because it interacts badly with different character sets. Layouts are loaded by the 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 In economics, internationalization or internationalisation is the process of increasing involvement of enterprises in international markets, although there is no agreed definition of internationalization. Internationalization is a crucial strateg ...
of Linux at the kernel level started as early as in 1994 by Markus Kuhn and Andries Brouwer.


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, SVGAlib and display servers. Currently, there is no support for 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 Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode (so as to oc ...
. # Unicode supported since
Windows NT Windows NT is a proprietary graphical operating system produced by Microsoft, the first version of which was released on July 27, 1993. It is a processor-independent, multiprocessing and multi-user operating system. The first version of Win ...
based systems, which 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. No Unicode support in non-NT versions of Windows # As non-ASCII keyboard layout should be reloaded because of flawed implementation. #
Kernel mode settings
in recent kernels make this more practical for some video hardware.


Linux framebuffer console

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 overcome 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.


Linux serial port console

Linux serial console is a console implementation via
serial port In computing, a serial port is a serial communication interface through which information transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which communicates multiple bits simultaneously in parallel. ...
, enabled by option CONFIG_SERIAL_CONSOLE in the kernel configuration. It may be used in some
embedded system An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' ...
s, 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 In telecommunications, RS-232 or Recommended Standard 232 is a standard originally introduced in 1960 for serial communication transmission of data. It formally defines signals connecting between a ''DTE'' (''data terminal equipment'') such ...
. A serial console is often used during development of software for embedded systems, and is sometimes left accessible via a debug port.


Control characters

The console responds to a number of control characters: For ^ ANSI CSI Mode sequences, and DEC Private Mode sequences. These extended sequences can control colors, visual effects like blinking, underline, intensity and inverse video, bell tone frequency and duration, VESA screen blanking interval. Aside from the textual blanking, there is no known way to place the VGA adapter into standby.


Future plans

The Kmscon projects aims to create a modern user-space replacement for the Linux console. Development priorities include support for multi-monitor setups, Unicode font rendering with Pango, XKB keyboard handling, and
GPU A graphics processing unit (GPU) is a specialized electronic circuit designed to manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systems, mobi ...
OpenGL acceleration. Complaints about the current kernel implementation include "that it's a user-interface in kernel-space, the code is poorly maintained, handles keyboards badly, produces bad font rendering, misses out on mode-setting and multi-head support, contains no multi-seat awareness, and only has limited hot-plugging handling, limited to
VT102 The VT100 is a video terminal, introduced in August 1978 by Digital Equipment Corporation (DEC). It was one of the first terminals to support ANSI escape codes for cursor control and other tasks, and added a number of extended codes for special f ...
compliance."


List of /dev/ entries related to the console


See also

*
Windows Console Windows Console is the infrastructure for console applications in Microsoft Windows. An instance of a Windows Console has a screen buffer and an input buffer. It allows console apps to run inside a window or in hardware text mode (so as to oc ...


References

{{Linux kernel Computer terminals Linux kernel Text user interface