Informasi Sains    
   
Daftar Isi
(Sebelumnya) LinuxLinux kernel (Berikutnya)

Linux console

The Linux console is a system console support in the Linux kernel. The Linux console was the first functionality of the kernel, developed as early as in 1991 (see history of Linux). On PC architecture, it is common to use 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

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. 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 layouts), 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 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 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, SVGAlib and X 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.

FeatureLinuxWindowsDOS
VGA text attributesYesYesYes
Custom fontsPossiblePossiblePossible
Character set512 glyphs max. (on VGA text),
any code page or UTF-8
223 or 256 characters (depends on access method),
any code page, no Unicode[n 1]
Run-time character set switchingPossible[n 2]Impossible[n 1]Depends on PoV
Terminal emulationYes, ANSI-compatible
(TERM=linux)
NoYes, ANSI
(with ANSI.SYS)
Run-time switching between text mode and GUITechnically possible, but usually impractical[n 3]No way to get back to GUIApplication dependent
Run-time changing numbers of rows and columnsPossiblePossibleApplication dependent
Switching between applicationsPossiblePossibleLimited
(some TSRs may be activated)
Non-standard modesPossibleImpossiblePossible
Mouse supportYes (with gpm or so)Application dependentSystem and application dependent
  1. a b 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.
  2. a As non-ASCII keyboard layout should be reloaded because of flawed implementation.
  3. a Kernel mode settings in recent kernels make this more practical for some video hardware.

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.

Daftar/Tabel -- /dev/ entries related to the console

NameMajorMinorDescription
/dev/tty1

/dev/tty63
c   41

63
virtual consoles
(keyboard controlled)
/dev/vcs1

/dev/vcs63
c   71

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

/dev/vcsa63
c   7129

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

See also

(Sebelumnya) LinuxLinux kernel (Berikutnya)