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