1 | .TH CONSOLE 4
|
---|
2 | .SH NAME
|
---|
3 | console, keyboard, log \- system console
|
---|
4 | .SH DESCRIPTION
|
---|
5 | The TTY device driver manages two devices related to the main user
|
---|
6 | interface, the system screen and the keyboard. These two together are
|
---|
7 | named "the Console".
|
---|
8 | .SS "The Screen"
|
---|
9 | The screen of a PC can be managed by a Monochrome Display Adapter, a
|
---|
10 | Hercules card, a Color Graphics Adapter, an Enhanced Graphics Adapter,
|
---|
11 | or a Video Graphics Array. To the console driver these devices are
|
---|
12 | seen as a block of video memory into which characters can be written to
|
---|
13 | be displayed, an I/O register that sets the video memory origin to the
|
---|
14 | character that is to be displayed on the top-left position of the
|
---|
15 | screen, and an I/O register that sets the position of the hardware
|
---|
16 | cursor. Each character within video memory is a two-byte word. The low
|
---|
17 | byte is the character code, and the high byte is the "attribute byte",
|
---|
18 | a set of bits that controls the way the character is displayed,
|
---|
19 | character and background colours for a colour card, or
|
---|
20 | intensity/underline/reverse video for monochrome.
|
---|
21 | .PP
|
---|
22 | These are the characteristics of the adapters in text mode:
|
---|
23 | .PP
|
---|
24 | .RS
|
---|
25 | .nf
|
---|
26 | .ta +15n +15n
|
---|
27 | Adapter 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
|
---|
37 | MDA and Hercules are the same to the console driver, because the graphics
|
---|
38 | mode of the Hercules is of no use to MINIX 3. EGA and VGA are also mostly
|
---|
39 | seen as the same in text mode. An EGA adapter is either a monochrome or a
|
---|
40 | colour device depending on the screen attached to it. A VGA adapter can run
|
---|
41 | in either monochrome or colour (grayscale) mode depending on how the Boot
|
---|
42 | Monitor has initialized it.
|
---|
43 | .PP
|
---|
44 | The driver uses the video origin to avoid copying the screen contents when
|
---|
45 | scrolling up or down. Instead the origin is simply moved one line. This is
|
---|
46 | named "hardware scrolling", as opposed to copying memory: "software
|
---|
47 | scrolling".
|
---|
48 | .PP
|
---|
49 | The video origin is also used to implement several virtual consoles inside
|
---|
50 | the video memory of the adapter. Each virtual console gets a segment of
|
---|
51 | video memory. The driver chooses which console to display by moving the
|
---|
52 | video origin. Note that an MDA or Hercules adapter can only support one
|
---|
53 | console. CGA can support up to four 80x25 consoles, and EGA and VGA can
|
---|
54 | have eight. It is best to configure one less console to leave some video
|
---|
55 | memory free so that hardware scrolling has some space to work in.
|
---|
56 | .PP
|
---|
57 | Character codes are used as indices into a display font that is stored in the
|
---|
58 | adapter. The default font is the IBM character set, which is an ASCII
|
---|
59 | character set in the low 128 codes, and a number of mathematical, greek,
|
---|
60 | silly graphics, and accented characters in the upper 128 codes. This font
|
---|
61 | is fixed in the MDA, Hercules and CGA adapters, but can be replaced by a
|
---|
62 | user selected font for the EGA and VGA adapters.
|
---|
63 | .PP
|
---|
64 | A number of control characters and escape sequences are implemented by the
|
---|
65 | driver. The result is upward compatible with the ANSI standard terminal.
|
---|
66 | The
|
---|
67 | .BR termcap (5)
|
---|
68 | type is
|
---|
69 | .BR minix .
|
---|
70 | Normal characters written to the console are displayed at the cursor
|
---|
71 | position and the cursor is advanced one column to the right. If an entire
|
---|
72 | line is filled then the cursor wraps to the first column of the next line
|
---|
73 | when the next character must be displayed. The screen is scrolled up if
|
---|
74 | needed to start a new line. Some characters have special effects when sent
|
---|
75 | to the console. Some even have arguments in the form of comma separated
|
---|
76 | decimal numbers. These numbers default to the lowest possible value when
|
---|
77 | omitted. The top-left character is at position (1, 1). The following
|
---|
78 | control characters and escape sequences are implemented by the console:
|
---|
79 | .PP
|
---|
80 | .ta +10n +20n
|
---|
81 | Sequence 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
|
---|
89 | left 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
|
---|
92 | columns 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
|
---|
95 | necessary
|
---|
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
|
---|
106 | necessary
|
---|
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,
|
---|
117 | column \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
|
---|
177 | Note: The "bold" versions of black, brown and lt gray become dark gray,
|
---|
178 | yellow and white.
|
---|
179 | .in -31n
|
---|
180 | .PP
|
---|
181 | The console device implements the following ioctl to copy a font into
|
---|
182 | font memory on EGA and VGA adapters:
|
---|
183 | .PP
|
---|
184 | .RS
|
---|
185 | .BI "ioctl(" fd ", TIOCSFON, u8_t " font "[256][32]);"
|
---|
186 | .RE
|
---|
187 | .PP
|
---|
188 | Font memory consists of 256 character definitions of 32 lines per character
|
---|
189 | and 8 pixels per line. The first line is the topmost line of the character.
|
---|
190 | The leftmost pixel is lit if the most significant bit of a line is set, etc.
|
---|
191 | How many lines are used depends on the current video mode. The 80x25 video
|
---|
192 | mode used by MINIX 3 has an 8x16 character cell, 80x28 has 8x14 characters,
|
---|
193 | and 132x43 or 132x50 has 8x8 characters. The boot variable
|
---|
194 | .B console
|
---|
195 | is used by both the Boot Monitor and the console driver to set the video
|
---|
196 | mode, software scrolling on/off, and VGA screen blank timeout. See
|
---|
197 | .BR boot (8).
|
---|
198 | .SS "The Keyboard"
|
---|
199 | The keyboard produces key codes for each key that is pressed. These keys
|
---|
200 | are transformed into character codes or sequences according to the current
|
---|
201 | keyboard translation table. The format of this table is described in
|
---|
202 | .BR keymap (5).
|
---|
203 | The character codes can be read from the console device unless they map to
|
---|
204 | special hotkeys. The hotkeys are as follows:
|
---|
205 | .PP
|
---|
206 | .ta +17n
|
---|
207 | Name Key Function
|
---|
208 | .in +18n
|
---|
209 | .ti -17n
|
---|
210 | CTRL\-ALT\-DEL Send an abort signal to process 1 (init). Init then
|
---|
211 | halts the system
|
---|
212 | .ti -17n
|
---|
213 | CTRL\-ALT\-KP-. Likewise for keypad period
|
---|
214 | .ti -17n
|
---|
215 | F1 Process table dump
|
---|
216 | .ti -17n
|
---|
217 | F2 Show memory map
|
---|
218 | .ti -17n
|
---|
219 | F3 Toggle software/hardware scrolling
|
---|
220 | .ti -17n
|
---|
221 | F5 Show network statistics
|
---|
222 | .ti -17n
|
---|
223 | CTRL\-F7 Send a quit signal to all processes connected to the console
|
---|
224 | .ti -17n
|
---|
225 | CTRL\-F8 Send an interrupt signal
|
---|
226 | .ti -17n
|
---|
227 | CTRL\-F9 Send a kill signal. If CTRL\-F8 or CTRL\-F7 don't get 'em,
|
---|
228 | then this surely will. These keys are for disaster recovery. You would
|
---|
229 | normally use DEL and CTRL\-\e to send interrupt and quit signals.
|
---|
230 | .\" .ig VC
|
---|
231 | .ti -17n
|
---|
232 | ALT\-F1 Select virtual console 0 (/dev/console)
|
---|
233 | .ti -17n
|
---|
234 | ALT\-F2 Select virtual console 1 (/dev/ttyc1)
|
---|
235 | .ti -17n
|
---|
236 | ALT\-F(\fIn\fP+1) Select virtual console \fIn\fP
|
---|
237 | (/dev/ttyc\fIn\fP)
|
---|
238 | .ti -17n
|
---|
239 | ALT\-Left Select previous virtual console
|
---|
240 | .ti -17n
|
---|
241 | ALT\-Right Select next virtual console
|
---|
242 | .\" ..
|
---|
243 | .in -18n
|
---|
244 | .PP
|
---|
245 | .\"XXX
|
---|
246 | The keyboard map is set with the
|
---|
247 | .B KIOCSMAP
|
---|
248 | ioctl whose precise details are currently hidden in the
|
---|
249 | .B loadkeys
|
---|
250 | utility.
|
---|
251 | .SS "Log device"
|
---|
252 | The
|
---|
253 | .B log
|
---|
254 | device can be used by processes to print debug messages onto the console.
|
---|
255 | The console is a terminal type device, so it is taken from processes when a
|
---|
256 | session 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
|
---|
263 | Output processing turns Line Feeds into CR LF sequences. Don't let this
|
---|
264 | surprise you. Either turn off output processing or use one of the synonyms
|
---|
265 | for LF.
|
---|
266 | .SH AUTHOR
|
---|
267 | Kees J. Bot (kjb@cs.vu.nl)
|
---|
268 | .\" minor editing of man page by asw 07.08.96
|
---|