xref: /dragonfly/share/man/man4/syscons.4 (revision f9993810)
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 June 18, 2022
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
58The
59.Nm
60driver provides multiple virtual terminals.
61It resembles the SCO color console driver.
62.Pp
63The
64.Nm
65driver is implemented on top of the keyboard driver
66.Pq Xr atkbd 4
67and the video card drivers
68.Xr ( amdgpu 4 ,
69.Xr i915 4 ,
70.Xr radeon 4 ,
71or
72.Xr vga 4 ) .
73Please see
74.Sx DRIVER CONFIGURATION
75below on how to make the console work with
76.Xr amdgpu 4 ,
77.Xr i915 4
78or
79.Xr radeon 4 .
80.Pp
81There can be only one
82.Nm
83device defined in the system.
84.Ss Virtual Terminals
85The
86.Nm
87driver provides multiple virtual terminals which appear as if they were
88separate terminals.
89One virtual terminal is considered current and exclusively
90occupies the screen and the keyboard; the other virtual terminals
91are placed in the background.
92.Pp
93In order to use virtual terminals, they must be individually
94marked ``on'' in
95.Pa /etc/ttys
96so that
97.Xr getty 8
98will recognize them to be active and run
99.Xr login 1
100to let the user log in to the system.
101By default, only the first eight virtual terminals are activated in
102.Pa /etc/ttys .
103.Pp
104You press the
105.Dv Alt
106key and a switch key to switch between
107virtual terminals.
108The following table summarizes the correspondence between the switch
109key and the virtual terminal.
110.Bd -literal -offset indent
111Alt-F1   ttyv0      Alt-F7   ttyv6      Shift-Alt-F1   ttyv10
112Alt-F2   ttyv1      Alt-F8   ttyv7      Shift-Alt-F2   ttyv11
113Alt-F3   ttyv2      Alt-F9   ttyv8      Shift-Alt-F3   ttyv12
114Alt-F4   ttyv3      Alt-F10  ttyv9      Shift-Alt-F4   ttyv13
115Alt-F5   ttyv4      Alt-F11  ttyv10     Shift-Alt-F5   ttyv14
116Alt-F6   ttyv5      Alt-F12  ttyv11     Shift-Alt-F6   ttyv15
117.Ed
118.Pp
119You can also use the ``nscr'' key (usually the
120.Dv PrintScreen
121key on the AT Enhanced keyboard) to cycle available virtual terminals.
122.Pp
123The default number of available virtual terminals is 16.
124This can be changed with the kernel configuration option
125.Dv MAXCONS
126(see below).
127.Pp
128Note that the X server usually requires a virtual terminal for display
129purposes, so at least one terminal must be left unused by
130.Xr getty 8
131so that it can be used by the X server.
132.Ss Key Definitions and Function Key Strings
133The
134.Nm
135driver, in conjunction with the keyboard driver, allows the user
136to change key definitions and function key strings.
137The
138.Xr kbdcontrol 1
139command will load a key definition file (known as ``keymap'' file),
140dump the current keymap, and assign a string to a function key.
141See
142.Xr keyboard 4
143and
144.Xr kbdmap 5
145for the keymap file.
146.Pp
147You may want to set the
148.Ar keymap
149variable in
150.Pa /etc/rc.conf.local
151to the desired keymap file so that it will be automatically loaded
152when the system starts up.
153.Ss Software Font
154For most modern video cards, e.g. VGA, the
155.Nm
156driver and the video card driver allow the user to change
157the font used on the screen.
158The
159.Xr vidcontrol 1
160command can be used to load a font file from
161.Pa /usr/share/syscons/fonts .
162.Pp
163The font comes in various sizes: 8x8, 8x14 and 8x16.
164The 8x16 font is typically used for the VGA card in the
16580-column-by-25-line mode.
166Other video modes may require different font sizes.
167It is better to always load all three sizes of the same font.
168.Pp
169You may set
170.Ar font8x8 ,
171.Ar font8x14
172and
173.Ar font8x16
174variables in
175.Pa /etc/rc.conf
176to the desired font files so that they will be automatically loaded
177when the system starts up.
178.Pp
179Optionally you can specify a particular font file as the default.
180See the
181.Dv SC_DFLT_FONT
182option below.
183.Ss Screen Map
184If your video card does not support software fonts, you may still be able
185to achieve a similar effect by re-mapping the font built into your video card.
186Use
187.Xr vidcontrol 1
188to load a screen map file which defines the mapping between character codes.
189.Ss Mouse Support and Copy-and-Paste
190You can use your mouse to copy text on the screen and paste it as if
191it was typed by hand.
192You must be running the mouse daemon
193.Xr moused 8
194and enable the mouse cursor in the virtual terminal via
195.Xr vidcontrol 1 .
196.Pp
197Pressing mouse button 1 (usually the left button) will start selection.
198Releasing button 1 will end the selection process.
199The selected text will be marked by inverting foreground and
200background colors.
201You can press button 3 (usually the right button) to extend
202the selected region.
203The selected text is placed in the copy buffer and can be pasted
204at the cursor position by pressing button 2 (usually the
205middle button) as many times as you like.
206.Pp
207If your mouse has only two buttons, you may want to use the
208.Dv SC_TWOBUTTON_MOUSE
209option below to make the right button to paste the text.
210Alternatively you can make the mouse daemon
211emulate the middle button.
212See the man page for
213.Xr moused 8
214for more details.
215.Ss Back Scrolling
216The
217.Nm
218driver allows the user to browse the output which has ``scrolled off''
219the top of the screen.
220.Pp
221Press the ``slock'' key (usually
222.Dv ScrllLock
223/
224.Dv Scroll Lock
225or
226.Dv Pause
227on many keyboards) and the terminal is
228in the ``scrollback'' mode.
229It is indicated by the
230.Dv Scroll Lock
231LED.
232Use the arrow keys, the
233.Dv Page Up/Down
234keys and the
235.Dv Home/End
236keys to scroll buffered terminal output.
237Press the ``slock'' key again to get back to the normal terminal mode.
238.Pp
239The size of the scrollback buffer can be set by the
240.Dv SC_HISTORY_SIZE
241option described below.
242.Ss Screen Saver
243The
244.Nm
245driver can be made to put up the screen saver if the current
246virtual terminal is idle, that is, the user is not typing
247on the keyboard nor moving the mouse.
248See
249.Xr splash 4
250and
251.Xr vidcontrol 1
252for more details.
253.Sh DRIVER CONFIGURATION
254.Ss Loader Tunables
255The following tunables are available and can be set in
256.Xr loader.conf 5 .
257.Bl -tag -width ".Va kern.kms_console"
258.It Va kern.kms_console
259Setting this tunable to 0 disables experimental framebuffer support
260in conjunction with the
261.Xr amdgpu 4 ,
262.Xr i915 4
263or
264.Xr radeon 4
265drivers.
266It is 1 by default.
267.It Va kern.kms_columns
268The number of columns to use in conjunction with the
269.Xr amdgpu 4 ,
270.Xr i915 4
271and
272.Xr radeon 4
273drivers.
274The font size is scaled to match the requested number of columns.
275This requires
276.Va kern.kms_console
277to be set to 1.
278By default,
279.Nm
280tries to find a more or less pleasant looking default.
281Setting
282.Va kern.kms_columns
283to a negative value turns off scaling.
284Please note that
285.Pa ttyv0
286is restricted to 160 columns and any setting of
287.Va kern.kms_columns
288resulting in a higher number of columns will be ignored for
289.Pa ttyv0 ,
290but applied to other virtual terminals.
291.El
292.Ss Sysctl Variables
293The following
294.Xr sysctl 8
295variable is available and can be either set via
296.Xr sysctl.conf 5
297or from the command line.
298.Bl -tag -width ".Va kern.syscons_async"
299.It Va kern.syscons_async
300Set to 1 to enable asynchronous bulk framebuffer updates.
301It is intended to help with
302.Xr sound 4
303stuttering when a high resolution
304.Nm
305scrolls during playback.
306It is not enabled by default because on certain machines it has led to
307subtle issues with for example
308.Xr ddb 4 .
309.El
310.Ss Kernel Configuration Options
311The following kernel configuration options control the
312.Nm
313driver.
314.Bl -tag -width MOUSE
315.It Dv MAXCONS=N
316This option sets the number of virtual terminals to
317.Fa N .
318The default value is 16.
319.It Dv SC_ALT_MOUSE_IMAGE
320This option selects the alternative way of displaying the mouse cursor
321in the virtual terminal.
322It may be expensive for some video cards to draw the arrow-shaped
323cursor, and you may want to try this option.
324However, the appearance of the alternative mouse cursor may not be
325very appealing.
326Note that if you use the
327.Dv SC_NO_FONT_LOADING
328option then you must also use this option if you wish to be able to use
329the mouse.
330.It Dv SC_DISABLE_DDBKEY
331This option disables the ``debug'' key combination (by default, it is
332.Dv Alt-Esc ,
333or
334.Dv Ctl-PrintScreen ) .
335It will prevent users from
336entering the kernel debugger (DDB) by pressing the key combination.
337DDB will still be invoked when the kernel panics or hits a break point
338if it is included in the kernel.
339.It Dv SC_DISABLE_REBOOT
340This option disables the ``reboot'' key (by default, it is
341.Dv Ctl-Alt-Del ) ,
342so that the casual user may not accidentally reboot the system.
343.It Dv SC_HISTORY_SIZE=N
344Sets the size of back scroll buffer to
345.Fa N
346lines.
347The default value is 100.
348.It Dv SC_MOUSE_CHAR=C
349Unless the
350.Dv SC_ALT_MOUSE_IMAGE
351option above is specified, the
352.Nm
353driver reserves four consecutive character codes in order to display the
354mouse cursor in the virtual terminals in some systems.
355This option specifies the first character code to
356.Fa C
357to be used for this purpose.
358The default value is 0xd0.
359A good candidate is 0x03.
360.It Dv SC_PIXEL_MODE
361Adds support for pixel (raster) mode console.
362This mode is useful on some laptop computers, but less so on
363most other systems, and it adds substantial amount of code to
364.Nm .
365If this option is NOT defined, you can reduce the kernel size a lot.
366.It Dv SC_TWOBUTTON_MOUSE
367If you have a two button mouse, you may want to add this option
368to use the right button of the mouse to paste text.
369See
370.Sx Mouse Support and Copy-and-Paste
371above.
372.It Dv SC_NORM_ATTR=_attribute_
373.It Dv SC_NORM_REV_ATTR=_attribute_
374.It Dv SC_KERNEL_CONS_ATTR=_attribute_
375.It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
376.It Dv SC_BORDER_COLOR=_attribute_
377These options will set the default colors.
378Available colors are defined in
379.In machine/pc/display.h .
380See
381.Sx EXAMPLES
382below.
383.It Dv SC_DFLT_FONT
384This option will specify the default font.
385Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
386cp866 and cp866u.
38716-line, 14-line and 8-line font data will be compiled in.
388Without this option, the
389.Nm
390driver will use whatever font is already loaded in the video card,
391unless you explicitly load a software font at startup.
392See
393.Sx EXAMPLES
394below.
395.El
396.Pp
397The following options will remove some features from the
398.Nm
399driver and save kernel memory.
400.Bl -tag -width MOUSE
401.It Dv SC_NO_CUTPASTE
402This option disables ``copy and paste'' operation in virtual
403terminals.
404.It Dv SC_NO_FONT_LOADING
405The
406.Nm
407driver can load software fonts on some video cards.
408This option removes this feature.
409Note that if you still wish to use
410the mouse with this option then you must also use the
411.Dv SC_ALT_MOUSE_IMAGE
412option.
413.It Dv SC_NO_HISTORY
414This option disables back-scrolling in virtual terminals.
415.It Dv SC_NO_SYSMOUSE
416This option removes mouse support in the
417.Nm
418driver.
419The mouse daemon
420.Xr moused 8
421will fail if this option is defined.
422This option implies the
423.Dv SC_NO_CUTPASTE
424option too.
425.El
426.Ss Driver Flags
427The following driver flags can be used to control the
428.Nm
429driver.
430They can be set in the kernel configuration file.
431.Bl -tag -width bit_0
432.\".It bit 0 (VISUAL_BELL)
433.\"Uses the ``visual'' bell.
434.\"The screen will blink instead of generating audible sound.
435.\".It bit 1,2 (CURSOR_TYPE)
436.\"This option specifies the cursor appearance.
437.\"Possible values are:
438.\".Bl -tag -width TYPE -compact
439.\".It Dv 0
440.\"normal block cursor
441.\".It Dv 2
442.\"blinking block cursor
443.\".It Dv 4
444.\"underline cursor
445.\".It Dv 6
446.\"blinking underline (aka destructive) cursor
447.\".El
448.\".It bit 6 (QUIET_BELL)
449.\"This option suppresses the bell, whether audible or visual,
450.\"if it is rung in a background virtual terminal.
451.It 0x0100 (AUTODETECT_KBD)
452This option instructs the
453.Nm
454driver to periodically scan
455for a keyboard device if it is not currently attached to one.
456Otherwise, the driver only probes for a keyboard once during bootup.
457.El
458.Sh IOCTLS
459The following
460.Xr ioctl 2
461commands are defined for the
462.Nm
463driver in
464.In sys/consio.h .
465.Pp
466.Bl -tag -width CONS -compact
467.It Dv KDGETMODE Ar int *mode
468.It Dv KDSETMODE Ar int *mode
469Get or set the mode of the current (virtual) console. The
470.Dv mode
471can be one of:
472.Pp
473.Bl -tag -width KD_GRAPHICS -compact
474.It Dv KD_TEXT
475same as
476.Dv KD_TEXT0
477.It Dv KD_TEXT0
478Text mode, restore fonts and palette
479.It Dv KD_GRAPHICS
480Graphics mode
481.It Dv KD_TEXT1
482Text mode, don't restore fonts and palette
483.It Dv KD_PIXEL
484Raster (pixel) text mode
485.El
486.Pp
487.It Dv KDSBORDER Ar int *color
488Set the border color of the current (virtual) console.
489.Pp
490.It Dv KDRASTER Ar scr_size_t *sizes
491Set raster (pixel) text mode and adjust the current (virtual) console's
492geometry and font size. The
493.Vt scr_size_t
494argument structure is as follows:
495.Bd -literal
496struct _scr_size {
497	int	scr_size[3];
498};
499.Ed
500.Pp
501.It Dv GIO_SCRNMAP Ar scrmap_t *map
502.It Dv PIO_SCRNMAP Ar scrmap_t *map
503Get or set the screen map for the current (virtual) console. The
504.Vt scrmap_t
505argument structure is defined as follows:
506.Bd -literal
507struct _scrmap {
508	char	scrmap[256];
509};
510.Ed
511.Pp
512.It Dv GIO_ATTR Ar int *attr
513Get the current text attribute.
514.Pp
515.It Dv GIO_COLOR Ar int *color
516Get the current text color.
517.Pp
518.It Dv CONS_CURRENT Ar int *type
519Get the adapter type. This is equivalent to
520.Dv FBIO_ADPTYPE .
521.Pp
522.It Dv CONS_GET Ar int *mode
523Get the current video mode. This is equivalent to
524.Dv FBIO_GETMODE .
525.Pp
526.It Dv CONS_SET Ar int *mode
527Set the current video mode. This is equivalent to
528.Dv FBIO_SETMODE .
529.Pp
530.It Dv CONS_BLANKTIME Ar int *time
531Set the screen saver blank interval (in seconds).
532.Pp
533.It Dv CONS_CURSORTYPE Ar int *type
534Set the text cursor shape. The argument
535.Dv type
536can be one or more of the following:
537.Pp
538.Bl -tag -width CONS_BLINK_CURSOR -compact
539.It Dv CONS_BLINK_CURSOR
540Set for a blinking cursor, unset for a non-blinking cursor.
541.It Dv CONS_CHAR_CURSOR
542Set for an underscore-shaped cursor, unset for a rectangle.
543.El
544.Pp
545.It Dv CONS_BELLTYPE Ar int *type
546Set the bell type. The argument
547.Dv type
548is one or more of:
549.Pp
550.Bl -tag -width CONS_VISUAL_BELL -compact
551.It Dv CONS_VISUAL_BELL
552Set for a visual bell, unset for an audible bell.
553.It Dv CONS_QUIET_BELL
554Set to enable the bell, unset to disable it.
555.El
556.Pp
557.It Dv CONS_HISTORY Ar int *size
558Set the history (scroll back) buffer size (in lines).
559.Pp
560.It Dv CONS_CLRHIST
561Clear the history (scroll back) buffer.
562.Pp
563.It Dv CONS_IDLE Ar int *idle
564Check if the (virtual) console has been idle.
565.Pp
566.It Dv CONS_SAVERMODE Ar int *mode
567Set the screen saver mode. The argument
568.Dv mode
569can be one of:
570.Pp
571.Bl -tag -width CONS_LKM_SAVER -compact
572.It Dv CONS_NO_SAVER
573Disable screen saver
574.It Dv CONS_USR_SAVER
575Enable screen saver
576.It Dv CONS_LKM_SAVER
577Add a new screen saver
578.El
579.Pp
580.It Dv CONS_SAVERSTART Ar int *start
581Start or stop the screen saver.
582.Pp
583.It Dv PIO_FONT8x8 Ar fnt8_t *font
584.It Dv GIO_FONT8x8 Ar fnt8_t *font
585Get or set the 8x8 font. The
586.Vt fnt8_t
587argument structure is defined as follows:
588.Bd -literal
589struct fnt8 {
590	char	fnt8x8[8*256];
591};
592.Ed
593.Pp
594.It Dv PIO_FONT8x14 Ar fnt14_t *font
595.It Dv GIO_FONT8x14 Ar fnt14_t *font
596Get or set the 8x14 font. The
597.Vt fnt14_t
598argument structure is defined as follows:
599.Bd -literal
600struct fnt14 {
601	char	fnt8x14[14*256];
602};
603.Ed
604.Pp
605.It Dv PIO_FONT8x16 Ar fnt16_t *font
606.It Dv GIO_FONT8x16 Ar fnt16_t *font
607Get or set the 8x16 font. The
608.Vt fnt16_t
609argument structure is defined as follows:
610.Bd -literal
611struct fnt16 {
612	char	fnt8x16[16*256];
613};
614.Ed
615.Pp
616.It Dv CONS_GETINFO Ar vid_info_t *info
617Get information about the current video mode. The
618.Vt vid_info_t
619structure is defined as follows:
620.Bd -literal
621struct vid_info {
622	short		size;
623	short		m_num;
624	u_short		font_size;
625	u_short		mv_row, mv_col;
626	u_short		mv_rsz, mv_csz;
627	struct colors	mv_norm,
628			mv_rev,
629			mv_grfc;
630	u_char		mv_ovscan;
631	u_char		mk_keylock;
632};
633.Ed
634.Pp
635.It Dv CONS_GETVERS Ar int *version
636Get the version of the driver.
637.Pp
638.It Dv CONS_CURRENTADP Ar int *adapter
639Get the video adapter index. This is equivalent to
640.Dv FBIO_ADAPTER .
641.Pp
642.It Dv CONS_ADPINFO Ar video_adapter_info_t *info
643Get the video adapter information. This is equivalent to
644.Dv FBIO_ADPINFO .
645.Pp
646.It Dv CONS_MODEINFO Ar video_info_t *info
647Get the video mode information. This is equivalent to
648.Dv FBIO_MODEINFO .
649.Pp
650.It Dv CONS_FINDMODE Ar video_info_t *info
651Find a video mode. This is equivalent to
652.Dv FBIO_FINDMODE .
653.Pp
654.It Dv CONS_SETWINORG Ar u_int *origin
655Set the frame buffer window origin. This is equivalent to
656.Dv FBIO_SETWINORG .
657.Pp
658.It Dv CONS_SETKBD Ar int *kbd
659Set a new keyboard.
660.Pp
661.It Dv CONS_RELKBD
662Release the current keyboard.
663.Pp
664.It Dv CONS_SCRSHOT Ar scrshot_t *data
665Make a snapshot of the current video buffer. The
666.Vt scrshot_t
667structure is defined as:
668.Bd -literal
669struct scrshot {
670	int		xsize;
671	int		ysize;
672	u_int16_t*	buf;
673};
674.Ed
675.Pp
676.It Dv CONS_GETTERM Ar term_info_t *info
677.It Dv CONS_SETTERM Ar term_info_t *info
678Get or set terminal characteristics. The
679.Vt term_info_t
680structure is defined as:
681.Bd -literal
682struct term_info {
683	int		ti_index;
684	int		ti_flags;
685	u_char		ti_name[TI_NAME_LEN];
686	u_char		ti_desc[TI_DESC_LEN];
687};
688.Ed
689.Pp
690.It Dv VT_OPENQRY Ar int *term
691Get the next available terminal.
692.Pp
693.It Dv VT_SETMODE Ar vtmode_t *mode
694.It Dv VT_GETMODE Ar vtmode_t *mode
695Get or set the terminal switching mode. The
696.Vt vtmode_t
697argument structure is defined as follows:
698.Bd -literal
699struct vt_mode {
700	char		mode;
701	char		waitv;
702	short		relsig;
703	short		acqsig;
704	short		frsig;
705};
706.Ed
707.Pp
708.It Dv VT_RELDISP Ar int *ack
709Acknowledge the release or acquisition of a terminal. The
710.Dv ack
711argument can be one of:
712.Pp
713.Bl -tag -width VT_ACKACQ -compact
714.It Dv VT_FALSE
715The user refuses to release the screen, abort
716.It Dv VT_TRUE
717The user has released the screen, go on
718.It Dv VT_ACKACQ
719Acquisition of the screen acknowledged, switch completed
720.El
721.Pp
722.It Dv VT_ACTIVATE Ar int *term
723Activate the specified terminal.
724.Pp
725.It Dv VT_WAITACTIVE Ar int *term
726Wait until the specified terminal is active.
727.Pp
728.It Dv VT_GETACTIVE Ar int *term
729Get the currently active terminal.
730.Pp
731.It Dv VT_GETINDEX Ar int *index
732Get the index of the terminal.
733.Pp
734.It Dv VT_LOCKSWITCH Ar int *lock
735Prevent or permit terminal switching.
736.El
737.Sh FILES
738.Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
739.It Pa /dev/console
740.It Pa /dev/consolectl
741.It Pa /dev/ttyv?
742virtual terminals
743.It Pa /etc/ttys
744terminal initialization information
745.It Pa /usr/share/syscons/fonts/*
746font files
747.It Pa /usr/share/syscons/keymaps/*
748key map files
749.It Pa /usr/share/syscons/scrmaps/*
750screen map files
751.El
752.Sh EXAMPLES
753As the
754.Nm
755driver requires the keyboard driver and the video card driver,
756the kernel configuration file should contain the following lines.
757.Pp
758.D1 Cd device atkbdc0 at isa? port IO_KBD
759.D1 Cd device atkbd0 at atkbdc? irq 1
760.D1 Cd device vga0 at isa?
761.D1 Cd device sc0 at isa?
762.D1 Cd pseudo-device splash
763.Pp
764If you do not intend to load the splash image or use the screen saver,
765the last line is not necessary, and can be omitted.
766.Pp
767Note that the keyboard controller driver
768.Nm atkbdc
769is required by the keyboard driver
770.Nm atkbd .
771.Pp
772The following lines will set the default colors.
773The normal text will be green on black background.
774The reversed text will be yellow on green background.
775Note that you cannot put any white space inside the quoted string,
776because of the current implementation of
777.Xr config 8 .
778.Pp
779.D1 Cd "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)"
780.D1 Cd "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)"
781.Pp
782The following lines will set the default colors of the kernel message.
783The kernel message will be printed bright red on black background.
784The reversed message will be black on red background.
785.Pp
786.D1 Cd "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)"
787.D1 Cd "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)"
788.Pp
789The following line will set the default border color of the terminal.
790If the console is in framebuffer mode, or in raster (pixel) text mode,
791a thin green border will be visible around the terminal if the screen
792size is not an exact multiple of the font size.
793This border area can be much larger if the column or row count is
794explicitly specified (for example when using the
795.Va kern.kms_columns
796tunable).
797.Pp
798.D1 Cd "options SC_BORDER_COLOR=FG_GREEN"
799.Pp
800The following example adds the font files
801.Pa cp850-8x16.fnt ,
802.Pa cp850-8x14.font
803and
804.Pa cp850-8x8.font
805to the kernel.
806.Pp
807.D1 Cd "options SC_DFLT_FONT"
808.D1 Cd "makeoptions SC_DFLT_FONT=cp850"
809.D1 Cd "device sc0 at isa?"
810.\".Sh DIAGNOSTICS
811.Sh CAVEATS
812The amount of data that is possible to insert from the cut buffer is limited
813by the
814.Brq Dv MAX_INPUT ,
815a system limit on the number of bytes that may be stored in the terminal
816input queue - usually 1024 bytes
817(see
818.Xr termios 4 ) .
819.Sh SEE ALSO
820.Xr kbdcontrol 1 ,
821.Xr login 1 ,
822.Xr vidcontrol 1 ,
823.Xr atkbd 4 ,
824.Xr atkbdc 4 ,
825.Xr keyboard 4 ,
826.Xr screen 4 ,
827.Xr splash 4 ,
828.Xr sysmouse 4 ,
829.Xr ukbd 4 ,
830.Xr vga 4 ,
831.Xr kbdmap 5 ,
832.Xr rc.conf 5 ,
833.Xr ttys 5 ,
834.Xr getty 8 ,
835.Xr kldload 8 ,
836.Xr moused 8
837.Sh HISTORY
838The
839.Nm
840driver first appeared in
841.Fx 1.0 .
842.Sh AUTHORS
843.An -nosplit
844The
845.Nm
846driver was written by
847.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org .
848This manual page was written by
849.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org
850and
851.An Sascha Wildner .
852.Sh BUGS
853This manual page is incomplete and needs revision.
854