CONSOLE(4) Linux Programmer’s Manual CONSOLE(4) 名前 console - コンソール端末 (console terminal) と仮想コンソール (virtual console) 説明 Linux システムは普通、/dev/ttyn (n は 1 ≤ n ≤ 63) と呼ばれる仮想コン ソ ール (メジャーナンバー (major number) 4 マイナーナンバー (minor number) 1 から 63 のキャラクターデバイス (character device)) を持つ。現在のコン ソールは /dev/console または /dev/tty0 (メジャーナンバー 4 マイナーナン バー 0 のキャラクターデバイス) によっても扱える。デバ イ ス フ ァ イ ル (device file) /dev/* は普通 MAKEDEV スクリプトまたは mknod(1) を使って モード 0622、所有者 root.tty として作成される。 カーネル (kernel) バージョン 1.1.54 以前は、仮想コンソールの数はコン パ イル時に (tty.h 中の : #define NR_CONSOLES 8 によって) カーネルに埋め込 まれていた。そして、それを変更してコンパイルし直すことで仮想コンソー ル の 数を変更できた。カーネルバージョン 1.1.54 以降では仮想コンソールが必 要とされる時はすぐに動作中に作成される。 コンソール上でプロセスを開始する一般的な方法は: (a) コン ソ ー ル 上 で mingetty(8) (または agetty(8)) をスタートさせることを (inittab(5) の中 で) init(8) に伝える。 (b) コンソール上でプロセスをスタートするこ と を openvt(1) に頼む。 (c) X を開始する - X は使われていないコンソールのう ち最初のものを見付け、そこに表示を出力する。(昔ながらの doshell(8) もあ る。) コ ンソールを切り替える一般的な方法は: (a)コンソール n に切り替えるため に Alt+Fn または Ctrl+Alt+Fn を使う。 AltGr+Fn を使うと、おそらくコンソ ール n+12 に切り替わる [ここでの Alt と AltGr はそれぞれ左右の Alt キー を示す]。 (b) 現在割り当てられているコンソールを循環するために Alt + 右 矢印キーまたは Alt + 左矢印キーを使う。(c) chvt(1) プログラムを使う (キ ーマッピングはユーザがセットできる、 loadkeys(1) を見よ。上で述べたキー バインドはデフォルトの設定によるものである)。 deallocvt(1) コマンド(以前は disalloc という名前だった)は、プロセスに結 びつけられていないコンソールのスクリーンバッファ (screen buffer) のため に使われているメモリを解放する。 特性 コ ンソールは多くの状態をもっている。私は、それについていつかドキュメン トにしたいと考えている。もっとも重要な事実はコンソールは vt100 端末を真 似ている (シミュレートしている) ということである。コンソールは ESC c と いう二つの文字を印字する事によって、初期状態にリセットされる。エスケ ー プ シーケンス (escape sequences) については console_codes(4) で全て説明 してある。 ファイル /dev/console /dev/tty* 関連項目 chvt(1), deallocvt(1), loadkeys(1), mknod(1), openvt(1), con- sole_codes(4), console_ioctl(4), tty(4), ttyS(4), charsets(7), agetty(8), init(8), mapscrn(8), mingetty(8), resizecons(8), setfont(8) Linux 1994-10-31 CONSOLE(4)
CONSOLE(4) Linux Programmer’s Manual CONSOLE(4) NAME console - console terminal and virtual consoles DESCRIPTION A Linux system has up to 63 virtual consoles (character devices with major number 4 and minor number 1 to 63), usually called /dev/ttyn with 1 ≤ n ≤ 63. The current console is also addressed by /dev/console or /dev/tty0, the character device with major number 4 and minor number 0. The device files /dev/* are usually created using the script MAKEDEV, or using mknod(1), usually with mode 0622 and owner root.tty. Before kernel version 1.1.54 the number of virtual consoles was com- piled into the kernel (in tty.h: #define NR_CONSOLES 8) and could be changed by editing and recompiling. Since version 1.1.54 virtual con- soles are created on the fly, as soon as they are needed. Common ways to start a process on a console are: (a) tell init(8) (in inittab(5)) to start a mingetty(8) (or agetty(8)) on the console; (b) ask openvt(1) to start a process on the console; (c) start X — it will find the first unused console, and display its output there. (There is also the ancient doshell(8).) Common ways to switch consoles are: (a) use Alt+Fn or Ctrl+Alt+Fn to switch to console n; AltGr+Fn might bring you to console n+12 [here Alt and AltGr refer to the left and right Alt keys, respectively]; (b) use Alt+RightArrow or Alt+LeftArrow to cycle through the presently allo- cated consoles; (c) use the program chvt(1). (The key mapping is user settable, see loadkeys(1); the above mentioned key combinations are according to the default settings.) The command deallocvt(1) (formerly disalloc) will free the memory taken by the screen buffers for consoles that no longer have any associated process. Properties Consoles carry a lot of state. I hope to document that some other time. The most important fact is that the consoles simulate vt100 ter- minals. In particular, a console is reset to the initial state by printing the two characters ESC c. All escape sequences can be found in console_codes(4). FILES /dev/console /dev/tty* SEE ALSO chvt(1), deallocvt(1), loadkeys(1), mknod(1), openvt(1), con- sole_codes(4), console_ioctl(4), tty(4), ttyS(4), charsets(7), agetty(8), init(8), mapscrn(8), mingetty(8), resizecons(8), setfont(8) COLOPHON This page is part of release 3.22 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 1994-10-31 CONSOLE(4)
コロナウイルスの日ごとの感染者数・死者数をグラフ化してみました。どの国が増加傾向にあり、どの国が終息に向かっているかを視覚化しています。
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa