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