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