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