Initial import from FreeBSD RELENG_4:
[games.git] / share / man / man4 / syscons.4
1 .\"
2 .\" Copyright (c) 1999
3 .\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4 .\" All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer as
11 .\"    the first lines of this file unmodified.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\"
27 .\" $FreeBSD: src/share/man/man4/syscons.4,v 1.10.2.14 2003/04/25 21:21:36 brueffer Exp $
28 .\"
29 .Dd June 30, 1999
30 .Dt SYSCONS 4
31 .Os
32 .Sh NAME
33 .Nm syscons ,
34 .Nm sc
35 .Nd the console driver
36 .Sh SYNOPSIS
37 .Cd "options MAXCONS=N"
38 .Cd "options SC_ALT_MOUSE_IMAGE"
39 .Cd "options SC_DISABLE_DDBKEY"
40 .Cd "options SC_DISABLE_REBOOT"
41 .Cd "options SC_HISTORY_SIZE=N"
42 .Cd "options SC_MOUSE_CHAR=C"
43 .Cd "options SC_NO_CUTPASTE"
44 .Cd "options SC_NO_FONT_LOADING"
45 .Cd "options SC_NO_HISTORY"
46 .Cd "options SC_NO_PALETTE_LOADING"
47 .Cd "options SC_NO_SYSMOUSE"
48 .Cd "options SC_PIXEL_MODE"
49 .Cd "options SC_TWOBUTTON_MOUSE"
50 .Cd "options SC_NORM_ATTR=_attribute_"
51 .Cd "options SC_NORM_REV_ATTR=_attribute_"
52 .Cd "options SC_KERNEL_CONS_ATTR=_attribute_"
53 .Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_"
54 .Cd "options SC_DFLT_FONT"
55 .Cd "makeoptions SC_DFLT_FONT=_font_name_"
56 .Cd "device sc0 at isa?" Op flags Ar flags
57 .Sh DESCRIPTION
58 The
59 .Nm
60 driver provides multiple virtual terminals.
61 It resembles the SCO color console driver.
62 .Pp
63 The
64 .Nm
65 driver is implemented on top of the keyboard driver
66 .Pq Xr atkbd 4
67 and the video card driver
68 .Pq Xr vga 4
69 and so requires both of them to be configured in the system.
70 .Pp
71 There can be only one
72 .Nm
73 device defined in the system.
74 .Ss Virtual Terminals
75 The
76 .Nm
77 driver provides multiple virtual terminals which appear as if they were
78 separate terminals.
79 One virtual terminal is considered current and exclusively
80 occupies the screen and the keyboard; the other virtual terminals
81 are placed in the background.
82 .Pp
83 In order to use virtual terminals, they must be individually
84 marked ``on'' in
85 .Pa /etc/ttys
86 so that
87 .Xr getty 8
88 will recognize them to be active and run
89 .Xr login 1
90 to let the user log in to the system.
91 By default, only the first eight virtual terminals are activated in
92 .Pa /etc/ttys .
93 .Pp
94 You press the
95 .Dv Alt
96 key and a switch key to switch between
97 virtual terminals.
98 The following table summarizes the correspondence between the switch
99 key and the virtual terminal.
100 .Bd -literal -offset indent
101 Alt-F1   ttyv0      Alt-F7   ttyv6      Shift-Alt-F1   ttyv10
102 Alt-F2   ttyv1      Alt-F8   ttyv7      Shift-Alt-F2   ttyv11
103 Alt-F3   ttyv2      Alt-F9   ttyv8      Shift-Alt-F3   ttyv12
104 Alt-F4   ttyv3      Alt-F10  ttyv9      Shift-Alt-F4   ttyv13
105 Alt-F5   ttyv4      Alt-F11  ttyv10     Shift-Alt-F5   ttyv14
106 Alt-F6   ttyv5      Alt-F12  ttyv11     Shift-Alt-F6   ttyv15
107 .Ed
108 .Pp
109 You can also use the ``nscr'' key (usually the
110 .Dv PrintScreen
111 key on the AT Enhanced keyboard) to cycle available virtual terminals.
112 .Pp
113 The default number of available virtual terminals is 16.
114 This can be changed with the kernel configuration option
115 .Dv MAXCONS
116 (see below).
117 .Pp
118 Note that the X server usually requires a virtual terminal for display
119 purposes, so at least one terminal must be left unused by
120 .Xr getty 8
121 so that it can be used by the X server.
122 .Ss Key Definitions and Function Key Strings
123 The
124 .Nm
125 driver, in conjunction with the keyboard driver, allows the user
126 to change key definitions and function key strings.
127 The
128 .Xr kbdcontrol 1
129 command will load a key definition file (known as ``keymap'' file),
130 dump the current keymap, and assign a string to a function key.
131 See
132 .Xr keyboard 4
133 and
134 .Xr kbdmap 5
135 for the keymap file.
136 .Pp
137 You may want to set the
138 .Ar keymap
139 variable in
140 .Pa /etc/rc.conf.local
141 to the desired keymap file so that it will be automatically loaded
142 when the system starts up.
143 .Ss Software Font
144 For most modern video cards, e.g. VGA, the
145 .Nm
146 driver and the video card driver allow the user to change
147 the font used on the screen.
148 The
149 .Xr vidcontrol 1
150 command can be used to load a font file from
151 .Pa /usr/share/syscons/fonts .
152 .Pp
153 The font comes in various sizes: 8x8, 8x14 and 8x16.
154 The 8x16 font is typically used for the VGA card in the
155 80-column-by-25-line mode.
156 Other video modes may require different font sizes.
157 It is better to always load all three sizes of the same font.
158 .Pp
159 You may set
160 .Ar font8x8 ,
161 .Ar font8x14
162 and
163 .Ar font8x16
164 variables in
165 .Pa /etc/rc.conf
166 to the desired font files so that they will be automatically loaded
167 when the system starts up.
168 .Pp
169 Optionally you can specify a particular font file as the default.
170 See the
171 .Dv SC_DFLT_FONT
172 option below.
173 .Ss Screen Map
174 If your video card does not support software fonts, you may still be able
175 to achieve a similar effect by re-mapping the font built into your video card.
176 Use
177 .Xr vidcontrol 1
178 to load a screen map file which defines the mapping between character codes.
179 .Ss Mouse Support and Copy-and-Paste
180 You can use your mouse to copy text on the screen and paste it as if
181 it was typed by hand.
182 You must be running the mouse daemon
183 .Xr moused 8
184 and enable the mouse cursor in the virtual terminal via
185 .Xr vidcontrol 1 .
186 .Pp
187 Pressing mouse button 1 (usually the left button) will start selection.
188 Releasing button 1 will end the selection process.
189 The selected text will be marked by inverting foreground and
190 background colors.
191 You can press button 3 (usually the right button) to extend
192 the selected region.
193 The selected text is placed in the copy buffer and can be pasted
194 at the cursor position by pressing button 2 (usually the
195 middle button) as many times as you like.
196 .Pp
197 If your mouse has only two buttons, you may want to use the
198 .Dv SC_TWOBUTTON_MOUSE
199 option below to make the right button to paste the text.
200 Alternatively you can make the mouse daemon
201 emulate the middle button.
202 See the man page for
203 .Xr moused 8
204 for more details.
205 .Ss Back Scrolling
206 The
207 .Nm
208 driver allows the user to browse the output which has ``scrolled off''
209 the top of the screen.
210 .Pp
211 Press the ``slock'' key (usually
212 .Dv ScrllLock
213 /
214 .Dv Scroll Lock
215 or
216 .Dv Pause
217 on many keyboards) and the terminal is
218 in the ``scrollback'' mode.
219 It is indicated by the
220 .Dv Scroll Lock
221 LED.
222 Use the arrow keys, the
223 .Dv Page Up/Down
224 keys and the
225 .Dv Home/End
226 keys to scroll buffered terminal output.
227 Press the ``slock'' key again to get back to the normal terminal mode.
228 .Pp
229 The size of the scrollback buffer can be set by the
230 .Dv SC_HISTORY_SIZE
231 option described below.
232 .Ss Screen Saver
233 The
234 .Nm
235 driver can be made to put up the screen saver if the current
236 virtual terminal is idle, that is, the user is not typing
237 on the keyboard nor moving the mouse.
238 See
239 .Xr splash 4
240 and
241 .Xr vidcontrol 1
242 for more details.
243 .Sh DRIVER CONFIGURATION
244 .Ss Kernel Configuration Options
245 The following kernel configuration options control the
246 .Nm
247 driver.
248 .Bl -tag -width MOUSE
249 .It Dv MAXCONS=N
250 This option sets the number of virtual terminals to
251 .Fa N .
252 The default value is 16.
253 .It Dv SC_ALT_MOUSE_IMAGE
254 This option selects the alternative way of displaying the mouse cursor
255 in the virtual terminal.
256 It may be expensive for some video cards to draw the arrow-shaped
257 cursor, and you may want to try this option.
258 However, the appearance of the alternative mouse cursor may not be
259 very appealing.
260 Note that if you use the
261 .Dv SC_NO_FONT_LOADING
262 option then you must also use this option if you wish to be able to use
263 the mouse.
264 .It Dv SC_DISABLE_DDBKEY
265 This option disables the ``debug'' key combination (by default, it is
266 .Dv Alt-Esc ,
267 or
268 .Dv Ctl-PrintScreen ) .
269 It will prevent users from
270 entering the kernel debugger (DDB) by pressing the key combination.
271 DDB will still be invoked when the kernel panics or hits a break point
272 if it is included in the kernel.
273 .It Dv SC_DISABLE_REBOOT
274 This option disables the ``reboot'' key (by default, it is
275 .Dv Ctl-Alt-Del ) ,
276 so that the casual user may not accidentally reboot the system.
277 .It Dv SC_HISTORY_SIZE=N
278 Sets the size of back scroll buffer to
279 .Fa N
280 lines.
281 The default value is 100.
282 .It Dv SC_MOUSE_CHAR=C
283 Unless the
284 .Dv SC_ALT_MOUSE_IMAGE
285 option above is specified, the
286 .Nm
287 driver reserves four consecutive character codes in order to display the
288 mouse cursor in the virtual terminals in some systems.
289 This option specifies the first character code to
290 .Fa C
291 to be used for this purpose.
292 The default value is 0xd0.
293 A good candidate is 0x03.
294 .It Dv SC_PIXEL_MODE
295 Adds support for pixel (raster) mode console.
296 This mode is useful on some laptop computers, but less so on
297 most other systems, and it adds substantial amount of code to syscons.
298 If this option is NOT defined, you can reduce the kernel size a lot.
299 See the
300 .Dv VESA800X600
301 flag below.
302 .It Dv SC_TWOBUTTON_MOUSE
303 If you have a two button mouse, you may want to add this option
304 to use the right button of the mouse to paste text.
305 See
306 .Sx Mouse Support and Copy-and-Paste
307 above.
308 .It Dv SC_NORM_ATTR=_attribute_
309 .It Dv SC_NORM_REV_ATTR=_attribute_
310 .It Dv SC_KERNEL_CONS_ATTR=_attribute_
311 .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
312 These options will set the default colors.
313 Available colors are defined in
314 .Pa /usr/include/machine/pc/display.h .
315 See
316 .Sx EXAMPLES
317 below.
318 .It Dv SC_DFLT_FONT
319 This option will specify the default font.
320 Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
321 cp866 and cp866u.
322 16-line, 14-line and 8-line font data will be compiled in.
323 Without this option, the
324 .Nm
325 driver will use whatever font is already loaded in the video card,
326 unless you explicitly load a software font at startup.
327 See
328 .Sx EXAMPLES
329 below.
330 .El
331 .Pp
332 The following options will remove some features from the
333 .Nm
334 driver and save kernel memory.
335 .Bl -tag -width MOUSE
336 .It Dv SC_NO_CUTPASTE
337 This option disables ``copy and paste'' operation in virtual
338 terminals.
339 .It Dv SC_NO_FONT_LOADING
340 The
341 .Nm
342 driver can load software fonts on some video cards.
343 This option removes this feature.
344 Note that if you still wish to use
345 the mouse with this option then you must also use the
346 .Dv SC_ALT_MOUSE_IMAGE
347 option.
348 .It Dv SC_NO_HISTORY
349 This option disables back-scrolling in virtual terminals.
350 .\".It Dv SC_NO_PALETTE_LOADING
351 .It Dv SC_NO_SYSMOUSE
352 This option removes mouse support in the
353 .Nm
354 driver.
355 The mouse daemon
356 .Xr moused 8
357 will fail if this option is defined.
358 This option implies the
359 .Dv SC_NO_CUTPASTE
360 option too.
361 .El
362 .Ss Driver Flags
363 The following driver flags can be used to control the
364 .Nm
365 driver.
366 They can be set either in the kernel configuration file
367 (see
368 .Xr config 8 ) ,
369 or else in the User Configuration Menu at boot
370 time
371 (see
372 .Xr boot 8 ) .
373 .Bl -tag -width bit_0
374 .\".It bit 0 (VISUAL_BELL)
375 .\"Uses the ``visual'' bell.
376 .\"The screen will blink instead of generating audible sound.
377 .\".It bit 1,2 (CURSOR_TYPE)
378 .\"This option specifies the cursor appearance.
379 .\"Possible values are:
380 .\".Bl -tag -width TYPE -compact
381 .\".It Dv 0
382 .\"normal block cursor
383 .\".It Dv 2
384 .\"blinking block cursor
385 .\".It Dv 4
386 .\"underline cursor
387 .\".It Dv 6
388 .\"blinking underline (aka destructive) cursor
389 .\".El
390 .\".It bit 6 (QUIET_BELL)
391 .\"This option suppresses the bell, whether audible or visual,
392 .\"if it is rung in a background virtual terminal.
393 .It 0x0080 (VESA800X600)
394 This option puts the video card in the VESA 800x600 pixel, 16 color
395 mode.
396 It may be useful for laptop computers for which the 800x600 mode
397 is otherwise unsupported by the X server.
398 Note that in order for this flag to work, the kernel must be
399 compiled with the
400 .Dv SC_PIXEL_MODE
401 option explained above.
402 .\"Note also that the ``copy-and-paste'' function is not currently supported
403 .\"in this mode and the mouse pointer will not be displayed.
404 .It 0x0100 (AUTODETECT_KBD)
405 This option instructs the syscons driver to periodically scan
406 for a keyboard device if it is not currently attached to one.
407 Otherwise, the driver only probes for a keyboard once during bootup.
408 .El
409 .Sh FILES
410 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
411 .It Pa /dev/console
412 .It Pa /dev/consolectl
413 .It Pa /dev/ttyv?
414 virtual terminals
415 .It Pa /etc/ttys
416 terminal initialization information
417 .It Pa /usr/share/syscons/fonts/*
418 font files
419 .It Pa /usr/share/syscons/keymaps/*
420 key map files
421 .It Pa /usr/share/syscons/scrmaps/*
422 screen map files
423 .El
424 .Sh EXAMPLES
425 As the
426 .Nm
427 driver requires the keyboard driver and the video card driver,
428 the kernel configuration file should contain the following lines.
429 .Pp
430 .Bd -literal -offset indent
431 device atkbdc0 at isa? port IO_KBD
432 device atkbd0 at atkbdc? irq 1
433 device vga0 at isa?
434 device sc0 at isa?
435
436 pseudo-device splash
437 .Ed
438 .Pp
439 If you do not intend to load the splash image or use the screen saver,
440 the last line is not necessary, and can be omitted.
441 .Pp
442 Note that the keyboard controller driver
443 .Nm atkbdc
444 is required by the keyboard driver
445 .Nm atkbd .
446 .Pp
447 The following lines will set the default colors.
448 The normal text will be green on black background.
449 The reversed text will be yellow on green background.
450 Note that you cannot put any white space inside the quoted string,
451 because of the current implementation of
452 .Xr config 8 .
453 .Pp
454 .Dl "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)
455 .Dl "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)
456 .Pp
457 The following lines will set the default colors of the kernel message.
458 The kernel message will be printed bright red on black background.
459 The reversed message will be black on red background.
460 .Pp
461 .Dl "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)
462 .Dl "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)
463 .Pp
464 The following example adds the font files
465 .Pa cp850-8x16.fnt ,
466 .Pa cp850-8x14.font
467 and
468 .Pa cp850-8x8.font
469 to the kernel.
470 .Pp
471 .Dl "options SC_DFLT_FONT"
472 .Dl "makeoptions SC_DFLT_FONT=cp850
473 .Dl "device sc0 at isa?
474 .Pp
475 .\".Sh DIAGNOSTICS
476 .Sh CAVEATS
477 The Amount of data that is possible to insert from the cut buffer is limited
478 by the
479 .Brq Dv MAX_INPUT ,
480 a system limit on the number of bytes that may be stored in the terminal
481 input queue - usually 1024 bytes
482 (see
483 .Xr termios 4 ) .
484 .Sh BUGS
485 This manual page is incomplete and urgently needs revision.
486 .Sh SEE ALSO
487 .Xr kbdcontrol 1 ,
488 .Xr login 1 ,
489 .Xr vidcontrol 1 ,
490 .Xr atkbd 4 ,
491 .Xr atkbdc 4 ,
492 .Xr keyboard 4 ,
493 .Xr screen 4 ,
494 .Xr splash 4 ,
495 .Xr ukbd 4 ,
496 .Xr vga 4 ,
497 .Xr kbdmap 5 ,
498 .Xr rc.conf 5 ,
499 .Xr ttys 5 ,
500 .Xr config 8 ,
501 .Xr getty 8 ,
502 .Xr kldload 8 ,
503 .Xr moused 8
504 .Sh HISTORY
505 The
506 .Nm
507 driver first appeared in
508 .Fx 1.0 .
509 .Sh AUTHORS
510 .An -nosplit
511 The
512 .Nm
513 driver was written by
514 .An S\(/oren Schmidt Aq sos@FreeBSD.org .
515 This manual page was written by
516 .An Kazutaka Yokota Aq yokota@FreeBSD.org .