source: trunk/minix/man/man4/console.4@ 20

Last change on this file since 20 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 8.8 KB
Line 
1.TH CONSOLE 4
2.SH NAME
3console, keyboard, log \- system console
4.SH DESCRIPTION
5The TTY device driver manages two devices related to the main user
6interface, the system screen and the keyboard. These two together are
7named "the Console".
8.SS "The Screen"
9The screen of a PC can be managed by a Monochrome Display Adapter, a
10Hercules card, a Color Graphics Adapter, an Enhanced Graphics Adapter,
11or a Video Graphics Array. To the console driver these devices are
12seen as a block of video memory into which characters can be written to
13be displayed, an I/O register that sets the video memory origin to the
14character that is to be displayed on the top-left position of the
15screen, and an I/O register that sets the position of the hardware
16cursor. Each character within video memory is a two-byte word. The low
17byte is the character code, and the high byte is the "attribute byte",
18a set of bits that controls the way the character is displayed,
19character and background colours for a colour card, or
20intensity/underline/reverse video for monochrome.
21.PP
22These are the characteristics of the adapters in text mode:
23.PP
24.RS
25.nf
26.ta +15n +15n
27Adapter Usable memory Mono/Colour
28.ta +1n +15n +15n
29 MDA 4K M
30 Hercules 4K M
31 CGA 16K C
32 EGA 32K M or C
33 VGA 32K M or C
34.fi
35.RE
36.PP
37MDA and Hercules are the same to the console driver, because the graphics
38mode of the Hercules is of no use to MINIX 3. EGA and VGA are also mostly
39seen as the same in text mode. An EGA adapter is either a monochrome or a
40colour device depending on the screen attached to it. A VGA adapter can run
41in either monochrome or colour (grayscale) mode depending on how the Boot
42Monitor has initialized it.
43.PP
44The driver uses the video origin to avoid copying the screen contents when
45scrolling up or down. Instead the origin is simply moved one line. This is
46named "hardware scrolling", as opposed to copying memory: "software
47scrolling".
48.PP
49The video origin is also used to implement several virtual consoles inside
50the video memory of the adapter. Each virtual console gets a segment of
51video memory. The driver chooses which console to display by moving the
52video origin. Note that an MDA or Hercules adapter can only support one
53console. CGA can support up to four 80x25 consoles, and EGA and VGA can
54have eight. It is best to configure one less console to leave some video
55memory free so that hardware scrolling has some space to work in.
56.PP
57Character codes are used as indices into a display font that is stored in the
58adapter. The default font is the IBM character set, which is an ASCII
59character set in the low 128 codes, and a number of mathematical, greek,
60silly graphics, and accented characters in the upper 128 codes. This font
61is fixed in the MDA, Hercules and CGA adapters, but can be replaced by a
62user selected font for the EGA and VGA adapters.
63.PP
64A number of control characters and escape sequences are implemented by the
65driver. The result is upward compatible with the ANSI standard terminal.
66The
67.BR termcap (5)
68type is
69.BR minix .
70Normal characters written to the console are displayed at the cursor
71position and the cursor is advanced one column to the right. If an entire
72line is filled then the cursor wraps to the first column of the next line
73when the next character must be displayed. The screen is scrolled up if
74needed to start a new line. Some characters have special effects when sent
75to the console. Some even have arguments in the form of comma separated
76decimal numbers. These numbers default to the lowest possible value when
77omitted. The top-left character is at position (1, 1). The following
78control characters and escape sequences are implemented by the console:
79.PP
80.ta +10n +20n
81Sequence Name Function
82.in +31n
83.ti -30n
84^@ Null Ignored (padding character)
85.ti -30n
86^G Bell Produce a short tone from the speaker
87.ti -30n
88^H Backspace Move the cursor back one column, wrapping from the
89left edge up one line to the right edge
90.ti -30n
91^I Horizontal Tab Move to the next tab stop, with each tab stop at
92columns 1, 9, 25, etc. Wrap to the next line if necessary.
93.ti -30n
94^J Line Feed Move one line down, scrolling the screen up if
95necessary
96.ti -30n
97^K Vertical Tab Same as LF
98.ti -30n
99^L Form Feed Same as LF
100.ti -30n
101^M Carriage Return Move to column 1
102.ti -30n
103^[ Escape Start of an escape sequence
104.ti -30n
105^[M Reverse Index Move one line up, scrolling the screen down if
106necessary
107.ti -30n
108^[[\fIn\fPA Cursor Up Move the cursor up \fIn\fP lines
109.ti -30n
110^[[\fIn\fPB Cursor Down Move the cursor down \fIn\fP lines
111.ti -30n
112^[[\fIn\fPC Cursor Forward Move the cursor right \fIn\fP columns
113.ti -30n
114^[[\fIn\fPD Cursor Backward Move the cursor left \fIn\fP columns
115.ti -30n
116^[[\fIm\fP;\fIn\fPH Cursor Position Move the cursor to line \fIm\fP,
117column \fIn\fP
118.ti -30n
119^[[\fIs\fPJ Erase in Display Clear characters as follows:
120.br
121\fIs\fP = 0: From cursor to end of screen
122.br
123\fIs\fP = 1: From start of screen to cursor
124.br
125\fIs\fP = 2: Entire screen
126.ti -30n
127^[[\fIs\fPK Erase in Line Clear characters as follows:
128.br
129\fIs\fP = 0: From cursor to end of line
130.br
131\fIs\fP = 1: From start of line to cursor
132.br
133\fIs\fP = 2: Entire line
134.ti -30n
135^[[\fIn\fPL Insert Lines Insert \fIn\fP blank lines
136.ti -30n
137^[[\fIn\fPM Delete Lines Delete \fIn\fP lines
138.ti -30n
139^[[\fIn\fP@ Insert Characters Insert \fIn\fP blank characters
140.ti -30n
141^[[\fIn\fPP Delete Characters Delete \fIn\fP characters
142.ti -30n
143^[[\fIn\fPm Character Attribute Set character attribute as follows:
144.br
145\fIn\fP = 0: Normal (default) attribute
146.br
147\fIn\fP = 1: Bold (high intensity fg colour)
148.br
149\fIn\fP = 4: Underline (mono) / Cyan (colour)
150.br
151\fIn\fP = 5: Blinking
152.br
153\fIn\fP = 7: Reverse Video
154.br
155\fIn\fP = 30: Black foreground colour
156.br
157\fIn\fP = 31: Red
158.br
159\fIn\fP = 32: Green
160.br
161\fIn\fP = 33: Brown
162.br
163\fIn\fP = 34: Blue
164.br
165\fIn\fP = 35: Magenta
166.br
167\fIn\fP = 36: Cyan
168.br
169\fIn\fP = 37: Light Gray
170.br
171\fIn\fP = 39: Default fg colour (lt gray)
172.br
173\fIn\fP = 40\-47: Same for background colour
174.br
175\fIn\fP = 49: Default bg colour (black)
176.br
177Note: The "bold" versions of black, brown and lt gray become dark gray,
178yellow and white.
179.in -31n
180.PP
181The console device implements the following ioctl to copy a font into
182font memory on EGA and VGA adapters:
183.PP
184.RS
185.BI "ioctl(" fd ", TIOCSFON, u8_t " font "[256][32]);"
186.RE
187.PP
188Font memory consists of 256 character definitions of 32 lines per character
189and 8 pixels per line. The first line is the topmost line of the character.
190The leftmost pixel is lit if the most significant bit of a line is set, etc.
191How many lines are used depends on the current video mode. The 80x25 video
192mode used by MINIX 3 has an 8x16 character cell, 80x28 has 8x14 characters,
193and 132x43 or 132x50 has 8x8 characters. The boot variable
194.B console
195is used by both the Boot Monitor and the console driver to set the video
196mode, software scrolling on/off, and VGA screen blank timeout. See
197.BR boot (8).
198.SS "The Keyboard"
199The keyboard produces key codes for each key that is pressed. These keys
200are transformed into character codes or sequences according to the current
201keyboard translation table. The format of this table is described in
202.BR keymap (5).
203The character codes can be read from the console device unless they map to
204special hotkeys. The hotkeys are as follows:
205.PP
206.ta +17n
207Name Key Function
208.in +18n
209.ti -17n
210CTRL\-ALT\-DEL Send an abort signal to process 1 (init). Init then
211halts the system
212.ti -17n
213CTRL\-ALT\-KP-. Likewise for keypad period
214.ti -17n
215F1 Process table dump
216.ti -17n
217F2 Show memory map
218.ti -17n
219F3 Toggle software/hardware scrolling
220.ti -17n
221F5 Show network statistics
222.ti -17n
223CTRL\-F7 Send a quit signal to all processes connected to the console
224.ti -17n
225CTRL\-F8 Send an interrupt signal
226.ti -17n
227CTRL\-F9 Send a kill signal. If CTRL\-F8 or CTRL\-F7 don't get 'em,
228then this surely will. These keys are for disaster recovery. You would
229normally use DEL and CTRL\-\e to send interrupt and quit signals.
230.\" .ig VC
231.ti -17n
232ALT\-F1 Select virtual console 0 (/dev/console)
233.ti -17n
234ALT\-F2 Select virtual console 1 (/dev/ttyc1)
235.ti -17n
236ALT\-F(\fIn\fP+1) Select virtual console \fIn\fP
237(/dev/ttyc\fIn\fP)
238.ti -17n
239ALT\-Left Select previous virtual console
240.ti -17n
241ALT\-Right Select next virtual console
242.\" ..
243.in -18n
244.PP
245.\"XXX
246The keyboard map is set with the
247.B KIOCSMAP
248ioctl whose precise details are currently hidden in the
249.B loadkeys
250utility.
251.SS "Log device"
252The
253.B log
254device can be used by processes to print debug messages onto the console.
255The console is a terminal type device, so it is taken from processes when a
256session leader exits. This does not happen with the log device.
257.SH "SEE ALSO"
258.BR tty (4),
259.BR loadkeys (1),
260.BR keymap (5),
261.BR boot (8).
262.SH NOTES
263Output processing turns Line Feeds into CR LF sequences. Don't let this
264surprise you. Either turn off output processing or use one of the synonyms
265for LF.
266.SH AUTHOR
267Kees J. Bot (kjb@cs.vu.nl)
268.\" minor editing of man page by asw 07.08.96
Note: See TracBrowser for help on using the repository browser.