Linux console (简体中文)
According to Wikipedia:
- The Linux console is a system console internal to the Linux kernel. 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 and reads the output text on a computer monitor. The Linux kernel supports virtual consoles - consoles that are logically separate, but which access the same physical keyboard and display.
This article describes the basics of the Linux console and how to configure the font display. Keyboard configuration is described in the /Keyboard configuration subpage.
The console, unlike most services that interact directly with users, is implemented in the kernel. This contrasts with terminal emulation software, such as Xterm, which is implemented in user space as a normal application. The console has always been part of released Linux kernels, but has undergone changes in its history, most notably the transition to using the framebuffer and support for Unicode.
Despite many improvements in the console, its full backward compatibility with legacy hardware means it is limited compared to a graphical terminal emulator.
The console is presented to the user as a series of virtual consoles. These give the impression that several independent terminals are running concurrently; each virtual console can be logged in with different users, run its own shell and have its own font settings. The virtual consoles each use a device
/dev/ttyX, and you can switch between them by pressing
x is equal to the virtual console number, beginning with 1). The device
/dev/console is automatically mapped to the active virtual console.
See also, and .
Since Linux originally began as a kernel for PC hardware, the console was developed using standard IBM CGA/EGA/VGA graphics, which all PCs supported at the time. The graphics operated in VGA text mode, which provides a simple 80x25 character display with 16 colours. This legacy mode is similar the capabilities of dedicated text terminals, such as the DEC VT100 series. It is still possible to boot in text mode if the system hardware supports it, but almost all modern distributions (including Arch Linux) use the framebuffer console instead.
As Linux was ported to other non-PC architectures, a better solution was required, since other architectures do not use VGA-compatible graphics adapters, and may not support text modes at all. The framebuffer console was implemented to provide a standard console across all platforms, and so presents the same VGA-style interface regardless of the underlying graphics hardware. As such, the Linux console is not a terminal emulator, but a terminal in its own right. It uses the terminal type
linux, and is largely compatible with VT100.
||Reboots the system (specified by the symlink |
||Switch to n-th virtual console|
||Switch to previous virtual console|
||Switch to next virtual console|
||When Scroll Lock is activated, input/output is locked|
||Kills current task|
||Inserts an EOF|
||Pauses current Task|
Linux console 默认使用 UTF-8 编码, 但是由于使用的是标准的兼容 VGA 的帧缓存, 终端字体限定为 256 或 512 个字形。如果字体超出了256个字形, 那么颜色的数量就会从 16 减少到 8。为了针对给定的 Unicode z值分配正确的可显示符号，一种特殊的翻译映射，通常叫做 unimap,是必须的。 就目前来看大多数终端字体都具有内置的 unimap, 但是历史上它是需要被单独载入的。
/usr/share/kbd/consolefonts/目录下, 那些以 .psfu 或者 .psfu.gz 结尾的具有一个内嵌的 Unicode 翻译映射。
键盘映射 (Keymap) 是按键和计算机使用字符的对应关系表，可以在
/usr/share/kbd/keymaps/ 的子目录下找到，详情请查看 Keyboard configuration in console 。
setfont 工具可以暂时改变字体，让用户可以决定是否要设为永久性设置。只要指定字体名称即可 (这些字体位于
$ setfont lat2-16
FONT 变量可以用来在启动时设置字体, 对于所有的终端都具有持久性作用。详情请查看 。
若要显示 Č, ž, đ, š 或 Ł, ę, ą, ś 之类的字符，请使用
这代表使用 ISO/IEC 8859 字符的第二部分，尺寸设置为 16。您可以使用其它值更改字体尺寸 (如
lat2-08)。您可以在Wikipedia的这张表查询 8859 规范定义的本地。
consolefont 勾子。更多信息请参阅 Mkinitcpio (简体中文)#钩子(HOOKS)。
See HiDPI#Linux console.
See PC speaker#Beep.