]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/man/man4/syscons.4
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.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$
28 .\"
29 .Dd July 21, 2014
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_CUT_SEPCHARS=_characters_"
40 .Cd "options SC_CUT_SPACES2TABS"
41 .Cd "options SC_DISABLE_KDBKEY"
42 .Cd "options SC_DISABLE_REBOOT"
43 .Cd "options SC_HISTORY_SIZE=N"
44 .Cd "options SC_MOUSE_CHAR=C"
45 .Cd "options SC_NO_CUTPASTE"
46 .Cd "options SC_NO_FONT_LOADING"
47 .Cd "options SC_NO_HISTORY"
48 .Cd "options SC_NO_PALETTE_LOADING"
49 .Cd "options SC_NO_SUSPEND_VTYSWITCH"
50 .Cd "options SC_NO_SYSMOUSE"
51 .Cd "options SC_PIXEL_MODE"
52 .Cd "options SC_TWOBUTTON_MOUSE"
53 .Cd "options SC_NORM_ATTR=_attribute_"
54 .Cd "options SC_NORM_REV_ATTR=_attribute_"
55 .Cd "options SC_KERNEL_CONS_ATTR=_attribute_"
56 .Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_"
57 .Cd "options SC_DFLT_FONT"
58 .Cd "makeoptions SC_DFLT_FONT=_font_name_"
59 .Cd "device sc"
60 .Pp
61 In
62 .Pa /boot/device.hints :
63 .Cd hint.sc.0.at="isa"
64 .Cd hint.sc.0.vesa_mode=0x103
65 .Pp
66 In
67 .Pa /boot/loader.conf :
68 .Cd kern.vty=sc
69 .Sh DESCRIPTION
70 The
71 .Nm
72 driver provides multiple virtual terminals.
73 It resembles the SCO color console driver.
74 .Pp
75 The
76 .Nm
77 driver is implemented on top of the keyboard driver
78 .Pq Xr atkbd 4
79 and the video card driver
80 .Pq Xr vga 4
81 and so requires both of them to be configured in the system.
82 .Pp
83 There can be only one
84 .Nm
85 device defined in the system.
86 .Ss Virtual Terminals
87 The
88 .Nm
89 driver provides multiple virtual terminals which appear as if they were
90 separate terminals.
91 One virtual terminal is considered current and exclusively
92 occupies the screen and the keyboard; the other virtual terminals
93 are placed in the background.
94 .Pp
95 In order to use virtual terminals, they must be individually
96 marked ``on'' in
97 .Pa /etc/ttys
98 so that
99 .Xr getty 8
100 will recognize them to be active and run
101 .Xr login 1
102 to let the user log in to the system.
103 By default, only the first eight virtual terminals are activated in
104 .Pa /etc/ttys .
105 .Pp
106 You press the
107 .Dv Alt
108 key and a switch key to switch between
109 virtual terminals.
110 The following table summarizes the correspondence between the switch
111 key and the virtual terminal.
112 .Bd -literal -offset indent
113 Alt-F1   ttyv0      Alt-F7   ttyv6      Shift-Alt-F1   ttyva
114 Alt-F2   ttyv1      Alt-F8   ttyv7      Shift-Alt-F2   ttyvb
115 Alt-F3   ttyv2      Alt-F9   ttyv8      Shift-Alt-F3   ttyvc
116 Alt-F4   ttyv3      Alt-F10  ttyv9      Shift-Alt-F4   ttyvd
117 Alt-F5   ttyv4      Alt-F11  ttyva      Shift-Alt-F5   ttyve
118 Alt-F6   ttyv5      Alt-F12  ttyvb      Shift-Alt-F6   ttyvf
119 .Ed
120 .Pp
121 You can also use the ``nscr'' key (usually the
122 .Dv PrintScreen
123 key on the AT Enhanced keyboard) to cycle available virtual terminals.
124 .Pp
125 The default number of available virtual terminals is 16.
126 This can be changed with the kernel configuration option
127 .Dv MAXCONS
128 (see below).
129 .Pp
130 Note that the X server usually requires a virtual terminal for display
131 purposes, so at least one terminal must be left unused by
132 .Xr getty 8
133 so that it can be used by the X server.
134 .Ss Key Definitions and Function Key Strings
135 The
136 .Nm
137 driver, in conjunction with the keyboard driver, allows the user
138 to change key definitions and function key strings.
139 The
140 .Xr kbdcontrol 1
141 command will load a key definition file (known as ``keymap'' file),
142 dump the current keymap, and assign a string to a function key.
143 See
144 .Xr keyboard 4
145 and
146 .Xr kbdmap 5
147 for the keymap file.
148 .Pp
149 You may want to set the
150 .Ar keymap
151 variable in
152 .Pa /etc/rc.conf.local
153 to the desired keymap file so that it will be automatically loaded
154 when the system starts up.
155 .Ss Software Font
156 For most modern video cards, e.g., VGA, the
157 .Nm
158 driver and the video card driver allow the user to change
159 the font used on the screen.
160 The
161 .Xr vidcontrol 1
162 command can be used to load a font file from
163 .Pa /usr/share/syscons/fonts .
164 .Pp
165 The font comes in various sizes: 8x8, 8x14 and 8x16.
166 The 8x16 font is typically used for the VGA card in the
167 80-column-by-25-line mode.
168 Other video modes may require different font sizes.
169 It is better to always load all three sizes of the same font.
170 .Pp
171 You may set
172 .Ar font8x8 ,
173 .Ar font8x14
174 and
175 .Ar font8x16
176 variables in
177 .Pa /etc/rc.conf
178 to the desired font files so that they will be automatically loaded
179 when the system starts up.
180 .Pp
181 Optionally you can specify a particular font file as the default.
182 See the
183 .Dv SC_DFLT_FONT
184 option below.
185 .Ss Screen Map
186 If your video card does not support software fonts, you may still be able
187 to achieve a similar effect by re-mapping the font built into your video card.
188 Use
189 .Xr vidcontrol 1
190 to load a screen map file which defines the mapping between character codes.
191 .Ss Mouse Support and Copy-and-Paste
192 You can use your mouse to copy text on the screen and paste it as if
193 it was typed by hand.
194 You must be running the mouse daemon
195 .Xr moused 8
196 and enable the mouse cursor in the virtual terminal via
197 .Xr vidcontrol 1 .
198 .Pp
199 Pressing mouse button 1 (usually the left button) will start selection.
200 Releasing button 1 will end the selection process.
201 The selected text will be marked by inverting foreground and
202 background colors.
203 You can press button 3 (usually the right button) to extend
204 the selected region.
205 The selected text is placed in the copy buffer and can be pasted
206 at the cursor position by pressing button 2 (usually the
207 middle button) as many times as you like.
208 .Pp
209 If your mouse has only two buttons, you may want to use the
210 .Dv SC_TWOBUTTON_MOUSE
211 option below to make the right button to paste the text.
212 Alternatively you can make the mouse daemon
213 emulate the middle button.
214 See the man page for
215 .Xr moused 8
216 for more details.
217 .Ss Back Scrolling
218 The
219 .Nm
220 driver allows the user to browse the output which has ``scrolled off''
221 the top of the screen.
222 .Pp
223 Press the ``slock'' key (usually
224 .Dv ScrllLock
225 /
226 .Dv Scroll Lock
227 or
228 .Dv Pause
229 on many keyboards) and the terminal is
230 in the ``scrollback'' mode.
231 It is indicated by the
232 .Dv Scroll Lock
233 LED.
234 Use the arrow keys, the
235 .Dv Page Up/Down
236 keys and the
237 .Dv Home/End
238 keys to scroll buffered terminal output.
239 Press the ``slock'' key again to get back to the normal terminal mode.
240 .Pp
241 The size of the scrollback buffer can be set by the
242 .Dv SC_HISTORY_SIZE
243 option described below.
244 .Ss Screen Saver
245 The
246 .Nm
247 driver can be made to put up the screen saver if the current
248 virtual terminal is idle, that is, the user is not typing
249 on the keyboard nor moving the mouse.
250 See
251 .Xr splash 4
252 and
253 .Xr vidcontrol 1
254 for more details.
255 .Sh DRIVER CONFIGURATION
256 .Ss Kernel Configuration Options
257 The following kernel configuration options control the
258 .Nm
259 driver.
260 .Bl -tag -width MOUSE
261 .It Dv MAXCONS=N
262 This option sets the number of virtual terminals to
263 .Fa N .
264 The default value is 16.
265 .It Dv SC_ALT_MOUSE_IMAGE
266 This option selects the alternative way of displaying the mouse cursor
267 in the virtual terminal.
268 It may be expensive for some video cards to draw the arrow-shaped
269 cursor, and you may want to try this option.
270 However, the appearance of the alternative mouse cursor may not be
271 very appealing.
272 Note that if you use the
273 .Dv SC_NO_FONT_LOADING
274 option then you must also use this option if you wish to be able to use
275 the mouse.
276 .It Dv SC_CUT_SEPCHARS=_characters_
277 This options specifies characters that will be looked for when the
278 driver searches for words boundaries when doing cut operation.
279 By default, its value is
280 .Qq Li \ex20
281 \(em a space character.
282 .It Dv SC_CUT_SPACES2TABS
283 This options instructs the driver to convert leading spaces into tabs
284 when copying data into cut buffer.
285 This might be useful to preserve
286 indentation when copying tab-indented text.
287 .It Dv SC_DISABLE_KDBKEY
288 This option disables the ``debug'' key combination (by default, it is
289 .Dv Alt-Esc ,
290 or
291 .Dv Ctl-PrintScreen ) .
292 It will prevent users from
293 entering the kernel debugger (KDB) by pressing the key combination.
294 KDB will still be invoked when the kernel panics or hits a break point
295 if it is included in the kernel.
296 If this option is not defined, this behavior may be controlled at runtime
297 by the
298 .Xr sysctl 8
299 variable
300 .Va hw.syscons.kbd_debug .
301 .It Dv SC_DISABLE_REBOOT
302 This option disables the ``reboot'' key (by default, it is
303 .Dv Ctl-Alt-Del ) ,
304 so that the casual user may not accidentally reboot the system.
305 If this option is not defined, this behavior may be controlled at runtime
306 by the
307 .Xr sysctl 8
308 variable
309 .Va hw.syscons.kbd_reboot .
310 .It Dv SC_HISTORY_SIZE=N
311 Sets the size of back scroll buffer to
312 .Fa N
313 lines.
314 The default value is 100.
315 .It Dv SC_MOUSE_CHAR=C
316 Unless the
317 .Dv SC_ALT_MOUSE_IMAGE
318 option above is specified, the
319 .Nm
320 driver reserves four consecutive character codes in order to display the
321 mouse cursor in the virtual terminals in some systems.
322 This option specifies the first character code to
323 .Fa C
324 to be used for this purpose.
325 The default value is 0xd0.
326 A good candidate is 0x03.
327 .It Dv SC_PIXEL_MODE
328 Adds support for pixel (raster) mode console.
329 This mode is useful on some laptop computers, but less so on
330 most other systems, and it adds substantial amount of code to syscons.
331 If this option is NOT defined, you can reduce the kernel size a lot.
332 See the
333 .Dv VESAMODE
334 flag below.
335 .It Dv SC_TWOBUTTON_MOUSE
336 If you have a two button mouse, you may want to add this option
337 to use the right button of the mouse to paste text.
338 See
339 .Sx Mouse Support and Copy-and-Paste
340 above.
341 .It Dv SC_NORM_ATTR=_attribute_
342 .It Dv SC_NORM_REV_ATTR=_attribute_
343 .It Dv SC_KERNEL_CONS_ATTR=_attribute_
344 .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
345 These options will set the default colors.
346 Available colors are defined in
347 .In machine/pc/display.h .
348 See
349 .Sx EXAMPLES
350 below.
351 .It Dv SC_DFLT_FONT
352 This option will specify the default font.
353 Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
354 cp866 and cp866u.
355 16-line, 14-line and 8-line font data will be compiled in.
356 Without this option, the
357 .Nm
358 driver will use whatever font is already loaded in the video card,
359 unless you explicitly load a software font at startup.
360 See
361 .Sx EXAMPLES
362 below.
363 .It Dv SC_NO_SUSPEND_VTYSWITCH
364 This option, which is also available as
365 .Xr loader 8
366 tunable and
367 .Xr sysctl 8
368 variable
369 .Va hw.syscons.sc_no_suspend_vtswitch ,
370 disables switching between virtual terminals (graphics <-> text) during
371 suspend/resume (ACPI and APM).
372 Use this option if your system is freezing
373 when you are running X and trying to suspend.
374 .El
375 .Pp
376 The following options will remove some features from the
377 .Nm
378 driver and save kernel memory.
379 .Bl -tag -width MOUSE
380 .It Dv SC_NO_CUTPASTE
381 This option disables ``copy and paste'' operation in virtual
382 terminals.
383 .It Dv SC_NO_FONT_LOADING
384 The
385 .Nm
386 driver can load software fonts on some video cards.
387 This option removes this feature.
388 Note that if you still wish to use
389 the mouse with this option then you must also use the
390 .Dv SC_ALT_MOUSE_IMAGE
391 option.
392 .It Dv SC_NO_HISTORY
393 This option disables back-scrolling in virtual terminals.
394 .\".It Dv SC_NO_PALETTE_LOADING
395 .It Dv SC_NO_SYSMOUSE
396 This option removes mouse support in the
397 .Nm
398 driver.
399 The mouse daemon
400 .Xr moused 8
401 will fail if this option is defined.
402 This option implies the
403 .Dv SC_NO_CUTPASTE
404 option too.
405 .El
406 .Ss Driver Flags
407 The following driver flags can be used to control the
408 .Nm
409 driver.
410 Driver flags can be set with the
411 .Cd hint.sc.0.flags
412 tunable, either in
413 .Pa /boot/device.hints ,
414 or else at the loader prompt (see
415 .Xr loader 8 ) .
416 .Bl -tag -width bit_0
417 .\".It bit 0 (VISUAL_BELL)
418 .\"Uses the ``visual'' bell.
419 .\"The screen will blink instead of generating audible sound.
420 .\".It bit 1,2 (CURSOR_TYPE)
421 .\"This option specifies the cursor appearance.
422 .\"Possible values are:
423 .\".Bl -tag -width TYPE -compact
424 .\".It Dv 0
425 .\"normal block cursor
426 .\".It Dv 2
427 .\"blinking block cursor
428 .\".It Dv 4
429 .\"underline cursor
430 .\".It Dv 6
431 .\"blinking underline (aka destructive) cursor
432 .\".El
433 .\".It bit 6 (QUIET_BELL)
434 .\"This option suppresses the bell, whether audible or visual,
435 .\"if it is rung in a background virtual terminal.
436 .It 0x0080 (VESAMODE)
437 This option puts the video card in the VESA mode specified by
438 .Pa /boot/device.hints
439 variable
440 .Va vesa_mode
441 during kernel initialization.
442 Note that in order for this flag to work, the kernel must be
443 compiled with the
444 .Dv SC_PIXEL_MODE
445 option explained above.
446 A list of the available mode can be obtained via
447 .Xr vidcontrol 1 .
448 .\"Note also that the ``copy-and-paste'' function is not currently supported
449 .\"in this mode and the mouse pointer will not be displayed.
450 .It 0x0100 (AUTODETECT_KBD)
451 This option instructs the syscons driver to periodically scan
452 for a keyboard device if it is not currently attached to one.
453 Otherwise, the driver only probes for a keyboard once during bootup.
454 .El
455 .Ss Loader Tunables
456 These settings can be entered at the
457 .Xr loader 8
458 prompt or in
459 .Xr loader.conf 5 .
460 .Bl -tag -width indent
461 .It Va kern.vty
462 When both
463 .Nm
464 and
465 .Xr vt 4
466 have been compiled into the kernel, the one to use for the system console can
467 be selected by setting this variable to
468 .Ql sc
469 or
470 .Ql vt .
471 If not set,
472 .Nm
473 provides the default system console.
474 .El
475 .Sh FILES
476 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
477 .It Pa /dev/console
478 .It Pa /dev/consolectl
479 .It Pa /dev/ttyv?
480 virtual terminals
481 .It Pa /etc/ttys
482 terminal initialization information
483 .It Pa /usr/share/syscons/fonts/*
484 font files
485 .It Pa /usr/share/syscons/keymaps/*
486 key map files
487 .It Pa /usr/share/syscons/scrmaps/*
488 screen map files
489 .El
490 .Sh EXAMPLES
491 As the
492 .Nm
493 driver requires the keyboard driver and the video card driver,
494 the kernel configuration file should contain the following lines.
495 .Bd -literal -offset indent
496 device atkbdc
497 device atkbd
498 device vga
499 device sc
500 device splash
501 .Ed
502 .Pp
503 You also need the following lines in
504 .Pa /boot/device.hints
505 for these drivers.
506 .Bd -literal -offset indent
507 hint.atkbdc.0.at="isa"
508 hint.atkbdc.0.port="0x060"
509 hint.atkbd.0.at="atkbdc"
510 hint.atkbd.0.irq="1"
511 hint.vga.0.at="isa"
512 hint.sc.0.at="isa"
513 .Ed
514 .Pp
515 If you do not intend to load the splash image or use the screen saver,
516 the last line is not necessary, and can be omitted.
517 .Pp
518 Note that the keyboard controller driver
519 .Nm atkbdc
520 is required by the keyboard driver
521 .Nm atkbd .
522 .Pp
523 The following lines will set the default colors.
524 The normal text will be green on black background.
525 The reversed text will be yellow on green background.
526 Note that you cannot put any white space inside the quoted string,
527 because of the current implementation of
528 .Xr config 8 .
529 .Pp
530 .Dl "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)"
531 .Dl "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)"
532 .Pp
533 The following lines will set the default colors of the kernel message.
534 The kernel message will be printed bright red on black background.
535 The reversed message will be black on red background.
536 .Pp
537 .Dl "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)"
538 .Dl "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)"
539 .Pp
540 The following example adds the font files
541 .Pa cp850-8x16.fnt ,
542 .Pa cp850-8x14.font
543 and
544 .Pa cp850-8x8.font
545 to the kernel.
546 .Pp
547 .Dl "options SC_DFLT_FONT"
548 .Dl "makeoptions SC_DFLT_FONT=cp850"
549 .Dl "device sc"
550 .\".Sh DIAGNOSTICS
551 .Sh SEE ALSO
552 .Xr kbdcontrol 1 ,
553 .Xr login 1 ,
554 .Xr vidcontrol 1 ,
555 .Xr atkbd 4 ,
556 .Xr atkbdc 4 ,
557 .Xr keyboard 4 ,
558 .Xr screen 4 ,
559 .Xr splash 4 ,
560 .Xr ukbd 4 ,
561 .Xr vga 4 ,
562 .Xr vt 4 ,
563 .Xr kbdmap 5 ,
564 .Xr rc.conf 5 ,
565 .Xr ttys 5 ,
566 .Xr config 8 ,
567 .Xr getty 8 ,
568 .Xr kldload 8 ,
569 .Xr moused 8
570 .Sh HISTORY
571 The
572 .Nm
573 driver first appeared in
574 .Fx 1.0 .
575 .Sh AUTHORS
576 .An -nosplit
577 The
578 .Nm
579 driver was written by
580 .An S\(/oren Schmidt Aq sos@FreeBSD.org .
581 This manual page was written by
582 .An Kazutaka Yokota Aq yokota@FreeBSD.org .
583 .Sh CAVEATS
584 The amount of data that is possible to insert from the cut buffer is limited
585 by the
586 .Brq Dv MAX_INPUT ,
587 a system limit on the number of bytes that may be stored in the terminal
588 input queue - usually 1024 bytes
589 (see
590 .Xr termios 4 ) .
591 .Sh BUGS
592 This manual page is incomplete and urgently needs revision.