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