Upgrade libarchive, bsdcat(1), bsdcpio(1) and bsdtar(1). 1/2
[dragonfly.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: src/share/man/man4/syscons.4,v 1.10.2.14 2003/04/25 21:21:36 brueffer Exp $
28 .\"
29 .Dd February 24, 2020
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_SYSMOUSE"
47 .Cd "options SC_PIXEL_MODE"
48 .Cd "options SC_TWOBUTTON_MOUSE"
49 .Cd "options SC_NORM_ATTR=_attribute_"
50 .Cd "options SC_NORM_REV_ATTR=_attribute_"
51 .Cd "options SC_KERNEL_CONS_ATTR=_attribute_"
52 .Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_"
53 .Cd "options SC_BORDER_COLOR=_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 drivers
68 .Xr ( i915 4 ,
69 .Xr radeon 4 ,
70 or
71 .Xr vga 4 ) .
72 Please see
73 .Sx DRIVER CONFIGURATION
74 below on how to make the console work with
75 .Xr i915 4
76 or
77 .Xr radeon 4 .
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   ttyv10
110 Alt-F2   ttyv1      Alt-F8   ttyv7      Shift-Alt-F2   ttyv11
111 Alt-F3   ttyv2      Alt-F9   ttyv8      Shift-Alt-F3   ttyv12
112 Alt-F4   ttyv3      Alt-F10  ttyv9      Shift-Alt-F4   ttyv13
113 Alt-F5   ttyv4      Alt-F11  ttyv10     Shift-Alt-F5   ttyv14
114 Alt-F6   ttyv5      Alt-F12  ttyv11     Shift-Alt-F6   ttyv15
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 Loader Tunables
253 The following tunables are available and can be set in
254 .Xr loader.conf 5 .
255 .Bl -tag -width ".Va kern.kms_console"
256 .It Va kern.kms_console
257 Setting this tunable to 0 disables experimental framebuffer support
258 in conjunction with the
259 .Xr i915 4
260 or
261 .Xr radeon 4
262 drivers.
263 It is 1 by default.
264 .It Va kern.kms_columns
265 The number of columns to use in conjunction with the
266 .Xr i915 4
267 and
268 .Xr radeon 4
269 drivers.
270 The font size is scaled to match the requested number of columns.
271 This requires
272 .Va kern.kms_console
273 to be set to 1.
274 By default,
275 .Nm
276 tries to find a more or less pleasant looking default.
277 Setting
278 .Va kern.kms_columns
279 to a negative value turns off scaling.
280 Please note that
281 .Pa ttyv0
282 is restricted to 160 columns and any setting of
283 .Va kern.kms_columns
284 resulting in a higher number of columns will be ignored for
285 .Pa ttyv0 ,
286 but applied to other virtual terminals.
287 .El
288 .Ss Sysctl Variables
289 The following
290 .Xr sysctl 8
291 variable is available and can be either set via
292 .Xr sysctl.conf 5
293 or from the command line.
294 .Bl -tag -width ".Va kern.syscons_async"
295 .It Va kern.syscons_async
296 Set to 1 to enable asynchronous bulk framebuffer updates.
297 It is intended to help with
298 .Xr sound 4
299 stuttering when a high resolution
300 .Nm
301 scrolls during playback.
302 It is not enabled by default because on certain machines it has led to
303 subtle issues with for example
304 .Xr ddb 4 .
305 .El
306 .Ss Kernel Configuration Options
307 The following kernel configuration options control the
308 .Nm
309 driver.
310 .Bl -tag -width MOUSE
311 .It Dv MAXCONS=N
312 This option sets the number of virtual terminals to
313 .Fa N .
314 The default value is 16.
315 .It Dv SC_ALT_MOUSE_IMAGE
316 This option selects the alternative way of displaying the mouse cursor
317 in the virtual terminal.
318 It may be expensive for some video cards to draw the arrow-shaped
319 cursor, and you may want to try this option.
320 However, the appearance of the alternative mouse cursor may not be
321 very appealing.
322 Note that if you use the
323 .Dv SC_NO_FONT_LOADING
324 option then you must also use this option if you wish to be able to use
325 the mouse.
326 .It Dv SC_DISABLE_DDBKEY
327 This option disables the ``debug'' key combination (by default, it is
328 .Dv Alt-Esc ,
329 or
330 .Dv Ctl-PrintScreen ) .
331 It will prevent users from
332 entering the kernel debugger (DDB) by pressing the key combination.
333 DDB will still be invoked when the kernel panics or hits a break point
334 if it is included in the kernel.
335 .It Dv SC_DISABLE_REBOOT
336 This option disables the ``reboot'' key (by default, it is
337 .Dv Ctl-Alt-Del ) ,
338 so that the casual user may not accidentally reboot the system.
339 .It Dv SC_HISTORY_SIZE=N
340 Sets the size of back scroll buffer to
341 .Fa N
342 lines.
343 The default value is 100.
344 .It Dv SC_MOUSE_CHAR=C
345 Unless the
346 .Dv SC_ALT_MOUSE_IMAGE
347 option above is specified, the
348 .Nm
349 driver reserves four consecutive character codes in order to display the
350 mouse cursor in the virtual terminals in some systems.
351 This option specifies the first character code to
352 .Fa C
353 to be used for this purpose.
354 The default value is 0xd0.
355 A good candidate is 0x03.
356 .It Dv SC_PIXEL_MODE
357 Adds support for pixel (raster) mode console.
358 This mode is useful on some laptop computers, but less so on
359 most other systems, and it adds substantial amount of code to
360 .Nm .
361 If this option is NOT defined, you can reduce the kernel size a lot.
362 .It Dv SC_TWOBUTTON_MOUSE
363 If you have a two button mouse, you may want to add this option
364 to use the right button of the mouse to paste text.
365 See
366 .Sx Mouse Support and Copy-and-Paste
367 above.
368 .It Dv SC_NORM_ATTR=_attribute_
369 .It Dv SC_NORM_REV_ATTR=_attribute_
370 .It Dv SC_KERNEL_CONS_ATTR=_attribute_
371 .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
372 .It Dv SC_BORDER_COLOR=_attribute_
373 These options will set the default colors.
374 Available colors are defined in
375 .In machine/pc/display.h .
376 See
377 .Sx EXAMPLES
378 below.
379 .It Dv SC_DFLT_FONT
380 This option will specify the default font.
381 Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
382 cp866 and cp866u.
383 16-line, 14-line and 8-line font data will be compiled in.
384 Without this option, the
385 .Nm
386 driver will use whatever font is already loaded in the video card,
387 unless you explicitly load a software font at startup.
388 See
389 .Sx EXAMPLES
390 below.
391 .El
392 .Pp
393 The following options will remove some features from the
394 .Nm
395 driver and save kernel memory.
396 .Bl -tag -width MOUSE
397 .It Dv SC_NO_CUTPASTE
398 This option disables ``copy and paste'' operation in virtual
399 terminals.
400 .It Dv SC_NO_FONT_LOADING
401 The
402 .Nm
403 driver can load software fonts on some video cards.
404 This option removes this feature.
405 Note that if you still wish to use
406 the mouse with this option then you must also use the
407 .Dv SC_ALT_MOUSE_IMAGE
408 option.
409 .It Dv SC_NO_HISTORY
410 This option disables back-scrolling in virtual terminals.
411 .It Dv SC_NO_SYSMOUSE
412 This option removes mouse support in the
413 .Nm
414 driver.
415 The mouse daemon
416 .Xr moused 8
417 will fail if this option is defined.
418 This option implies the
419 .Dv SC_NO_CUTPASTE
420 option too.
421 .El
422 .Ss Driver Flags
423 The following driver flags can be used to control the
424 .Nm
425 driver.
426 They can be set in the kernel configuration file.
427 .Bl -tag -width bit_0
428 .\".It bit 0 (VISUAL_BELL)
429 .\"Uses the ``visual'' bell.
430 .\"The screen will blink instead of generating audible sound.
431 .\".It bit 1,2 (CURSOR_TYPE)
432 .\"This option specifies the cursor appearance.
433 .\"Possible values are:
434 .\".Bl -tag -width TYPE -compact
435 .\".It Dv 0
436 .\"normal block cursor
437 .\".It Dv 2
438 .\"blinking block cursor
439 .\".It Dv 4
440 .\"underline cursor
441 .\".It Dv 6
442 .\"blinking underline (aka destructive) cursor
443 .\".El
444 .\".It bit 6 (QUIET_BELL)
445 .\"This option suppresses the bell, whether audible or visual,
446 .\"if it is rung in a background virtual terminal.
447 .It 0x0100 (AUTODETECT_KBD)
448 This option instructs the
449 .Nm
450 driver to periodically scan
451 for a keyboard device if it is not currently attached to one.
452 Otherwise, the driver only probes for a keyboard once during bootup.
453 .El
454 .Sh IOCTLS
455 The following
456 .Xr ioctl 2
457 commands are defined for the
458 .Nm
459 driver in
460 .In sys/consio.h .
461 .Pp
462 .Bl -tag -width CONS -compact
463 .It Dv KDGETMODE Ar int *mode
464 .It Dv KDSETMODE Ar int *mode
465 Get or set the mode of the current (virtual) console. The
466 .Dv mode
467 can be one of:
468 .Pp
469 .Bl -tag -width KD_GRAPHICS -compact
470 .It Dv KD_TEXT
471 same as
472 .Dv KD_TEXT0
473 .It Dv KD_TEXT0
474 Text mode, restore fonts and palette
475 .It Dv KD_GRAPHICS
476 Graphics mode
477 .It Dv KD_TEXT1
478 Text mode, don't restore fonts and palette
479 .It Dv KD_PIXEL
480 Raster (pixel) text mode
481 .El
482 .Pp
483 .It Dv KDSBORDER Ar int *color
484 Set the border color of the current (virtual) console.
485 .Pp
486 .It Dv KDRASTER Ar scr_size_t *sizes
487 Set raster (pixel) text mode and adjust the current (virtual) console's
488 geometry and font size. The
489 .Vt scr_size_t
490 argument structure is as follows:
491 .Bd -literal
492 struct _scr_size {
493         int     scr_size[3];
494 };
495 .Ed
496 .Pp
497 .It Dv GIO_SCRNMAP Ar scrmap_t *map
498 .It Dv PIO_SCRNMAP Ar scrmap_t *map
499 Get or set the screen map for the current (virtual) console. The
500 .Vt scrmap_t
501 argument structure is defined as follows:
502 .Bd -literal
503 struct _scrmap {
504         char    scrmap[256];
505 };
506 .Ed
507 .Pp
508 .It Dv GIO_ATTR Ar int *attr
509 Get the current text attribute.
510 .Pp
511 .It Dv GIO_COLOR Ar int *color
512 Get the current text color.
513 .Pp
514 .It Dv CONS_CURRENT Ar int *type
515 Get the adapter type. This is equivalent to
516 .Dv FBIO_ADPTYPE .
517 .Pp
518 .It Dv CONS_GET Ar int *mode
519 Get the current video mode. This is equivalent to
520 .Dv FBIO_GETMODE .
521 .Pp
522 .It Dv CONS_SET Ar int *mode
523 Set the current video mode. This is equivalent to
524 .Dv FBIO_SETMODE .
525 .Pp
526 .It Dv CONS_BLANKTIME Ar int *time
527 Set the screen saver blank interval (in seconds).
528 .Pp
529 .It Dv CONS_CURSORTYPE Ar int *type
530 Set the text cursor shape. The argument
531 .Dv type
532 can be one or more of the following:
533 .Pp
534 .Bl -tag -width CONS_BLINK_CURSOR -compact
535 .It Dv CONS_BLINK_CURSOR
536 Set for a blinking cursor, unset for a non-blinking cursor.
537 .It Dv CONS_CHAR_CURSOR
538 Set for an underscore-shaped cursor, unset for a rectangle.
539 .El
540 .Pp
541 .It Dv CONS_BELLTYPE Ar int *type
542 Set the bell type. The argument
543 .Dv type
544 is one or more of:
545 .Pp
546 .Bl -tag -width CONS_VISUAL_BELL -compact
547 .It Dv CONS_VISUAL_BELL
548 Set for a visual bell, unset for an audible bell.
549 .It Dv CONS_QUIET_BELL
550 Set to enable the bell, unset to disable it.
551 .El
552 .Pp
553 .It Dv CONS_HISTORY Ar int *size
554 Set the history (scroll back) buffer size (in lines).
555 .Pp
556 .It Dv CONS_CLRHIST
557 Clear the history (scroll back) buffer.
558 .Pp
559 .It Dv CONS_IDLE Ar int *idle
560 Check if the (virtual) console has been idle.
561 .Pp
562 .It Dv CONS_SAVERMODE Ar int *mode
563 Set the screen saver mode. The argument
564 .Dv mode
565 can be one of:
566 .Pp
567 .Bl -tag -width CONS_LKM_SAVER -compact
568 .It Dv CONS_NO_SAVER
569 Disable screen saver
570 .It Dv CONS_USR_SAVER
571 Enable screen saver
572 .It Dv CONS_LKM_SAVER
573 Add a new screen saver
574 .El
575 .Pp
576 .It Dv CONS_SAVERSTART Ar int *start
577 Start or stop the screen saver.
578 .Pp
579 .It Dv PIO_FONT8x8 Ar fnt8_t *font
580 .It Dv GIO_FONT8x8 Ar fnt8_t *font
581 Get or set the 8x8 font. The
582 .Vt fnt8_t
583 argument structure is defined as follows:
584 .Bd -literal
585 struct fnt8 {
586         char    fnt8x8[8*256];
587 };
588 .Ed
589 .Pp
590 .It Dv PIO_FONT8x14 Ar fnt14_t *font
591 .It Dv GIO_FONT8x14 Ar fnt14_t *font
592 Get or set the 8x14 font. The
593 .Vt fnt14_t
594 argument structure is defined as follows:
595 .Bd -literal
596 struct fnt14 {
597         char    fnt8x14[14*256];
598 };
599 .Ed
600 .Pp
601 .It Dv PIO_FONT8x16 Ar fnt16_t *font
602 .It Dv GIO_FONT8x16 Ar fnt16_t *font
603 Get or set the 8x16 font. The
604 .Vt fnt16_t
605 argument structure is defined as follows:
606 .Bd -literal
607 struct fnt16 {
608         char    fnt8x16[16*256];
609 };
610 .Ed
611 .Pp
612 .It Dv CONS_GETINFO Ar vid_info_t *info
613 Get information about the current video mode. The
614 .Vt vid_info_t
615 structure is defined as follows:
616 .Bd -literal
617 struct vid_info {
618         short           size;
619         short           m_num;
620         u_short         font_size;
621         u_short         mv_row, mv_col;
622         u_short         mv_rsz, mv_csz;
623         struct colors   mv_norm,
624                         mv_rev,
625                         mv_grfc;
626         u_char          mv_ovscan;
627         u_char          mk_keylock;
628 };
629 .Ed
630 .Pp
631 .It Dv CONS_GETVERS Ar int *version
632 Get the version of the driver.
633 .Pp
634 .It Dv CONS_CURRENTADP Ar int *adapter
635 Get the video adapter index. This is equivalent to
636 .Dv FBIO_ADAPTER .
637 .Pp
638 .It Dv CONS_ADPINFO Ar video_adapter_info_t *info
639 Get the video adapter information. This is equivalent to
640 .Dv FBIO_ADPINFO .
641 .Pp
642 .It Dv CONS_MODEINFO Ar video_info_t *info
643 Get the video mode information. This is equivalent to
644 .Dv FBIO_MODEINFO .
645 .Pp
646 .It Dv CONS_FINDMODE Ar video_info_t *info
647 Find a video mode. This is equivalent to
648 .Dv FBIO_FINDMODE .
649 .Pp
650 .It Dv CONS_SETWINORG Ar u_int *origin
651 Set the frame buffer window origin. This is equivalent to
652 .Dv FBIO_SETWINORG .
653 .Pp
654 .It Dv CONS_SETKBD Ar int *kbd
655 Set a new keyboard.
656 .Pp
657 .It Dv CONS_RELKBD
658 Release the current keyboard.
659 .Pp
660 .It Dv CONS_SCRSHOT Ar scrshot_t *data
661 Make a snapshot of the current video buffer. The
662 .Vt scrshot_t
663 structure is defined as:
664 .Bd -literal
665 struct scrshot {
666         int             xsize;
667         int             ysize;
668         u_int16_t*      buf;
669 };
670 .Ed
671 .Pp
672 .It Dv CONS_GETTERM Ar term_info_t *info
673 .It Dv CONS_SETTERM Ar term_info_t *info
674 Get or set terminal characteristics. The
675 .Vt term_info_t
676 structure is defined as:
677 .Bd -literal
678 struct term_info {
679         int             ti_index;
680         int             ti_flags;
681         u_char          ti_name[TI_NAME_LEN];
682         u_char          ti_desc[TI_DESC_LEN];
683 };
684 .Ed
685 .Pp
686 .It Dv VT_OPENQRY Ar int *term
687 Get the next available terminal.
688 .Pp
689 .It Dv VT_SETMODE Ar vtmode_t *mode
690 .It Dv VT_GETMODE Ar vtmode_t *mode
691 Get or set the terminal switching mode. The
692 .Vt vtmode_t
693 argument structure is defined as follows:
694 .Bd -literal
695 struct vt_mode {
696         char            mode;
697         char            waitv;
698         short           relsig;
699         short           acqsig;
700         short           frsig;
701 };
702 .Ed
703 .Pp
704 .It Dv VT_RELDISP Ar int *ack
705 Acknowledge the release or acquisition of a terminal. The
706 .Dv ack
707 argument can be one of:
708 .Pp
709 .Bl -tag -width VT_ACKACQ -compact
710 .It Dv VT_FALSE
711 The user refuses to release the screen, abort
712 .It Dv VT_TRUE
713 The user has released the screen, go on
714 .It Dv VT_ACKACQ
715 Acquisition of the screen acknowledged, switch completed
716 .El
717 .Pp
718 .It Dv VT_ACTIVATE Ar int *term
719 Activate the specified terminal.
720 .Pp
721 .It Dv VT_WAITACTIVE Ar int *term
722 Wait until the specified terminal is active.
723 .Pp
724 .It Dv VT_GETACTIVE Ar int *term
725 Get the currently active terminal.
726 .Pp
727 .It Dv VT_GETINDEX Ar int *index
728 Get the index of the terminal.
729 .Pp
730 .It Dv VT_LOCKSWITCH Ar int *lock
731 Prevent or permit terminal switching.
732 .El
733 .Sh FILES
734 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
735 .It Pa /dev/console
736 .It Pa /dev/consolectl
737 .It Pa /dev/ttyv?
738 virtual terminals
739 .It Pa /etc/ttys
740 terminal initialization information
741 .It Pa /usr/share/syscons/fonts/*
742 font files
743 .It Pa /usr/share/syscons/keymaps/*
744 key map files
745 .It Pa /usr/share/syscons/scrmaps/*
746 screen map files
747 .El
748 .Sh EXAMPLES
749 As the
750 .Nm
751 driver requires the keyboard driver and the video card driver,
752 the kernel configuration file should contain the following lines.
753 .Pp
754 .D1 Cd device atkbdc0 at isa? port IO_KBD
755 .D1 Cd device atkbd0 at atkbdc? irq 1
756 .D1 Cd device vga0 at isa?
757 .D1 Cd device sc0 at isa?
758 .D1 Cd pseudo-device splash
759 .Pp
760 If you do not intend to load the splash image or use the screen saver,
761 the last line is not necessary, and can be omitted.
762 .Pp
763 Note that the keyboard controller driver
764 .Nm atkbdc
765 is required by the keyboard driver
766 .Nm atkbd .
767 .Pp
768 The following lines will set the default colors.
769 The normal text will be green on black background.
770 The reversed text will be yellow on green background.
771 Note that you cannot put any white space inside the quoted string,
772 because of the current implementation of
773 .Xr config 8 .
774 .Pp
775 .D1 Cd "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)"
776 .D1 Cd "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)"
777 .Pp
778 The following lines will set the default colors of the kernel message.
779 The kernel message will be printed bright red on black background.
780 The reversed message will be black on red background.
781 .Pp
782 .D1 Cd "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)"
783 .D1 Cd "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)"
784 .Pp
785 The following line will set the default border color of the terminal.
786 If the console is in framebuffer mode, or in raster (pixel) text mode,
787 a thin green border will be visible around the terminal if the screen
788 size is not an exact multiple of the font size.
789 This border area can be much larger if the column or row count is
790 explicitly specified (for example when using the
791 .Va kern.kms_columns
792 tunable).
793 .Pp
794 .D1 Cd "options SC_BORDER_COLOR=FG_GREEN"
795 .Pp
796 The following example adds the font files
797 .Pa cp850-8x16.fnt ,
798 .Pa cp850-8x14.font
799 and
800 .Pa cp850-8x8.font
801 to the kernel.
802 .Pp
803 .D1 Cd "options SC_DFLT_FONT"
804 .D1 Cd "makeoptions SC_DFLT_FONT=cp850"
805 .D1 Cd "device sc0 at isa?"
806 .\".Sh DIAGNOSTICS
807 .Sh CAVEATS
808 The amount of data that is possible to insert from the cut buffer is limited
809 by the
810 .Brq Dv MAX_INPUT ,
811 a system limit on the number of bytes that may be stored in the terminal
812 input queue - usually 1024 bytes
813 (see
814 .Xr termios 4 ) .
815 .Sh SEE ALSO
816 .Xr kbdcontrol 1 ,
817 .Xr login 1 ,
818 .Xr vidcontrol 1 ,
819 .Xr atkbd 4 ,
820 .Xr atkbdc 4 ,
821 .Xr keyboard 4 ,
822 .Xr screen 4 ,
823 .Xr splash 4 ,
824 .Xr sysmouse 4 ,
825 .Xr ukbd 4 ,
826 .Xr vga 4 ,
827 .Xr kbdmap 5 ,
828 .Xr rc.conf 5 ,
829 .Xr ttys 5 ,
830 .Xr getty 8 ,
831 .Xr kldload 8 ,
832 .Xr moused 8
833 .Sh HISTORY
834 The
835 .Nm
836 driver first appeared in
837 .Fx 1.0 .
838 .Sh AUTHORS
839 .An -nosplit
840 The
841 .Nm
842 driver was written by
843 .An S\(/oren Schmidt Aq Mt sos@FreeBSD.org .
844 This manual page was written by
845 .An Kazutaka Yokota Aq Mt yokota@FreeBSD.org
846 and
847 .An Sascha Wildner .
848 .Sh BUGS
849 This manual page is incomplete and needs revision.