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