3 .\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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.
27 .\" $FreeBSD: src/share/man/man4/syscons.4,v 1.10.2.14 2003/04/25 21:21:36 brueffer Exp $
35 .Nd the console driver
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_BORDER_COLOR=_attribute_"
55 .Cd "options SC_DFLT_FONT"
56 .Cd "makeoptions SC_DFLT_FONT=_font_name_"
57 .Cd "device sc0 at isa?" Op flags Ar flags
61 driver provides multiple virtual terminals.
62 It resembles the SCO color console driver.
66 driver is implemented on top of the keyboard driver
68 and the video card drivers
74 .Sx DRIVER CONFIGURATION
75 below on how to make the console work with
82 device defined in the system.
86 driver provides multiple virtual terminals which appear as if they were
88 One virtual terminal is considered current and exclusively
89 occupies the screen and the keyboard; the other virtual terminals
90 are placed in the background.
92 In order to use virtual terminals, they must be individually
97 will recognize them to be active and run
99 to let the user log in to the system.
100 By default, only the first eight virtual terminals are activated in
105 key and a switch key to switch between
107 The following table summarizes the correspondence between the switch
108 key and the virtual terminal.
109 .Bd -literal -offset indent
110 Alt-F1 ttyv0 Alt-F7 ttyv6 Shift-Alt-F1 ttyv10
111 Alt-F2 ttyv1 Alt-F8 ttyv7 Shift-Alt-F2 ttyv11
112 Alt-F3 ttyv2 Alt-F9 ttyv8 Shift-Alt-F3 ttyv12
113 Alt-F4 ttyv3 Alt-F10 ttyv9 Shift-Alt-F4 ttyv13
114 Alt-F5 ttyv4 Alt-F11 ttyv10 Shift-Alt-F5 ttyv14
115 Alt-F6 ttyv5 Alt-F12 ttyv11 Shift-Alt-F6 ttyv15
118 You can also use the ``nscr'' key (usually the
120 key on the AT Enhanced keyboard) to cycle available virtual terminals.
122 The default number of available virtual terminals is 16.
123 This can be changed with the kernel configuration option
127 Note that the X server usually requires a virtual terminal for display
128 purposes, so at least one terminal must be left unused by
130 so that it can be used by the X server.
131 .Ss Key Definitions and Function Key Strings
134 driver, in conjunction with the keyboard driver, allows the user
135 to change key definitions and function key strings.
138 command will load a key definition file (known as ``keymap'' file),
139 dump the current keymap, and assign a string to a function key.
146 You may want to set the
149 .Pa /etc/rc.conf.local
150 to the desired keymap file so that it will be automatically loaded
151 when the system starts up.
153 For most modern video cards, e.g. VGA, the
155 driver and the video card driver allow the user to change
156 the font used on the screen.
159 command can be used to load a font file from
160 .Pa /usr/share/syscons/fonts .
162 The font comes in various sizes: 8x8, 8x14 and 8x16.
163 The 8x16 font is typically used for the VGA card in the
164 80-column-by-25-line mode.
165 Other video modes may require different font sizes.
166 It is better to always load all three sizes of the same font.
175 to the desired font files so that they will be automatically loaded
176 when the system starts up.
178 Optionally you can specify a particular font file as the default.
183 If your video card does not support software fonts, you may still be able
184 to achieve a similar effect by re-mapping the font built into your video card.
187 to load a screen map file which defines the mapping between character codes.
188 .Ss Mouse Support and Copy-and-Paste
189 You can use your mouse to copy text on the screen and paste it as if
190 it was typed by hand.
191 You must be running the mouse daemon
193 and enable the mouse cursor in the virtual terminal via
196 Pressing mouse button 1 (usually the left button) will start selection.
197 Releasing button 1 will end the selection process.
198 The selected text will be marked by inverting foreground and
200 You can press button 3 (usually the right button) to extend
202 The selected text is placed in the copy buffer and can be pasted
203 at the cursor position by pressing button 2 (usually the
204 middle button) as many times as you like.
206 If your mouse has only two buttons, you may want to use the
207 .Dv SC_TWOBUTTON_MOUSE
208 option below to make the right button to paste the text.
209 Alternatively you can make the mouse daemon
210 emulate the middle button.
217 driver allows the user to browse the output which has ``scrolled off''
218 the top of the screen.
220 Press the ``slock'' key (usually
226 on many keyboards) and the terminal is
227 in the ``scrollback'' mode.
228 It is indicated by the
231 Use the arrow keys, the
235 keys to scroll buffered terminal output.
236 Press the ``slock'' key again to get back to the normal terminal mode.
238 The size of the scrollback buffer can be set by the
240 option described below.
244 driver can be made to put up the screen saver if the current
245 virtual terminal is idle, that is, the user is not typing
246 on the keyboard nor moving the mouse.
252 .Sh DRIVER CONFIGURATION
254 The following tunables are available and can be set in
256 .Bl -tag -width ".Va kern.kms_console"
257 .It Va kern.kms_console
258 Setting this tunable to 0 disables experimental framebuffer support
259 in conjunction with the
265 .It Va kern.kms_columns
266 The number of columns to use in conjunction with the
271 The font size is scaled to match the requested number of columns.
277 tries to find a more or less pleasant looking default.
280 to a negative value turns off scaling.
285 variable is available and can be either set via
287 or from the command line.
288 .Bl -tag -width ".Va kern.syscons_async"
289 .It Va kern.syscons_async
290 Set to 1 to enable asynchronous bulk framebuffer updates.
291 It is intended to help with
293 stuttering when a high resolution
295 scrolls during playback.
296 It is not enabled by default because on certain machines it has lead to
297 subtle issues with for example
300 .Ss Kernel Configuration Options
301 The following kernel configuration options control the
304 .Bl -tag -width MOUSE
306 This option sets the number of virtual terminals to
308 The default value is 16.
309 .It Dv SC_ALT_MOUSE_IMAGE
310 This option selects the alternative way of displaying the mouse cursor
311 in the virtual terminal.
312 It may be expensive for some video cards to draw the arrow-shaped
313 cursor, and you may want to try this option.
314 However, the appearance of the alternative mouse cursor may not be
316 Note that if you use the
317 .Dv SC_NO_FONT_LOADING
318 option then you must also use this option if you wish to be able to use
320 .It Dv SC_DISABLE_DDBKEY
321 This option disables the ``debug'' key combination (by default, it is
324 .Dv Ctl-PrintScreen ) .
325 It will prevent users from
326 entering the kernel debugger (DDB) by pressing the key combination.
327 DDB will still be invoked when the kernel panics or hits a break point
328 if it is included in the kernel.
329 .It Dv SC_DISABLE_REBOOT
330 This option disables the ``reboot'' key (by default, it is
332 so that the casual user may not accidentally reboot the system.
333 .It Dv SC_HISTORY_SIZE=N
334 Sets the size of back scroll buffer to
337 The default value is 100.
338 .It Dv SC_MOUSE_CHAR=C
340 .Dv SC_ALT_MOUSE_IMAGE
341 option above is specified, the
343 driver reserves four consecutive character codes in order to display the
344 mouse cursor in the virtual terminals in some systems.
345 This option specifies the first character code to
347 to be used for this purpose.
348 The default value is 0xd0.
349 A good candidate is 0x03.
351 Adds support for pixel (raster) mode console.
352 This mode is useful on some laptop computers, but less so on
353 most other systems, and it adds substantial amount of code to
355 If this option is NOT defined, you can reduce the kernel size a lot.
356 .It Dv SC_TWOBUTTON_MOUSE
357 If you have a two button mouse, you may want to add this option
358 to use the right button of the mouse to paste text.
360 .Sx Mouse Support and Copy-and-Paste
362 .It Dv SC_NORM_ATTR=_attribute_
363 .It Dv SC_NORM_REV_ATTR=_attribute_
364 .It Dv SC_KERNEL_CONS_ATTR=_attribute_
365 .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
366 .It Dv SC_BORDER_COLOR=_attribute_
367 These options will set the default colors.
368 Available colors are defined in
369 .In machine/pc/display.h .
374 This option will specify the default font.
375 Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
377 16-line, 14-line and 8-line font data will be compiled in.
378 Without this option, the
380 driver will use whatever font is already loaded in the video card,
381 unless you explicitly load a software font at startup.
387 The following options will remove some features from the
389 driver and save kernel memory.
390 .Bl -tag -width MOUSE
391 .It Dv SC_NO_CUTPASTE
392 This option disables ``copy and paste'' operation in virtual
394 .It Dv SC_NO_FONT_LOADING
397 driver can load software fonts on some video cards.
398 This option removes this feature.
399 Note that if you still wish to use
400 the mouse with this option then you must also use the
401 .Dv SC_ALT_MOUSE_IMAGE
404 This option disables back-scrolling in virtual terminals.
405 .\".It Dv SC_NO_PALETTE_LOADING
406 .It Dv SC_NO_SYSMOUSE
407 This option removes mouse support in the
412 will fail if this option is defined.
413 This option implies the
418 The following driver flags can be used to control the
421 They can be set either in the kernel configuration file
424 or else in the User Configuration Menu at boot
428 .Bl -tag -width bit_0
429 .\".It bit 0 (VISUAL_BELL)
430 .\"Uses the ``visual'' bell.
431 .\"The screen will blink instead of generating audible sound.
432 .\".It bit 1,2 (CURSOR_TYPE)
433 .\"This option specifies the cursor appearance.
434 .\"Possible values are:
435 .\".Bl -tag -width TYPE -compact
437 .\"normal block cursor
439 .\"blinking block cursor
443 .\"blinking underline (aka destructive) cursor
445 .\".It bit 6 (QUIET_BELL)
446 .\"This option suppresses the bell, whether audible or visual,
447 .\"if it is rung in a background virtual terminal.
448 .It 0x0100 (AUTODETECT_KBD)
449 This option instructs the
451 driver to periodically scan
452 for a keyboard device if it is not currently attached to one.
453 Otherwise, the driver only probes for a keyboard once during bootup.
458 commands are defined for the
463 .Bl -tag -width CONS -compact
464 .It Dv KDGETMODE Ar int *mode
465 .It Dv KDSETMODE Ar int *mode
466 Get or set the mode of the current (virtual) console. The
470 .Bl -tag -width KD_GRAPHICS -compact
475 Text mode, restore fonts and palette
479 Text mode, don't restore fonts and palette
481 Raster (pixel) text mode
484 .It Dv KDSBORDER Ar int *color
485 Set the border color of the current (virtual) console.
487 .It Dv KDRASTER Ar scr_size_t *sizes
488 Set raster (pixel) text mode and adjust the current (virtual) console's
489 geometry and font size. The
491 argument structure is as follows:
498 .It Dv GIO_SCRNMAP Ar scrmap_t *map
499 .It Dv PIO_SCRNMAP Ar scrmap_t *map
500 Get or set the screen map for the current (virtual) console. The
502 argument structure is defined as follows:
509 .It Dv GIO_ATTR Ar int *attr
510 Get the current text attribute.
512 .It Dv GIO_COLOR Ar int *color
513 Get the current text color.
515 .It Dv CONS_CURRENT Ar int *type
516 Get the adapter type. This is equivalent to
519 .It Dv CONS_GET Ar int *mode
520 Get the current video mode. This is equivalent to
523 .It Dv CONS_SET Ar int *mode
524 Set the current video mode. This is equivalent to
527 .It Dv CONS_BLANKTIME Ar int *time
528 Set the screen saver blank interval (in seconds).
530 .It Dv CONS_CURSORTYPE Ar int *type
531 Set the text cursor shape. The argument
533 can be one or more of the following:
535 .Bl -tag -width CONS_BLINK_CURSOR -compact
536 .It Dv CONS_BLINK_CURSOR
537 Set for a blinking cursor, unset for a non-blinking cursor.
538 .It Dv CONS_CHAR_CURSOR
539 Set for an underscore-shaped cursor, unset for a rectangle.
542 .It Dv CONS_BELLTYPE Ar int *type
543 Set the bell type. The argument
547 .Bl -tag -width CONS_VISUAL_BELL -compact
548 .It Dv CONS_VISUAL_BELL
549 Set for a visual bell, unset for an audible bell.
550 .It Dv CONS_QUIET_BELL
551 Set to enable the bell, unset to disable it.
554 .It Dv CONS_HISTORY Ar int *size
555 Set the history (scroll back) buffer size (in lines).
558 Clear the history (scroll back) buffer.
560 .It Dv CONS_IDLE Ar int *idle
561 Check if the (virtual) console has been idle.
563 .It Dv CONS_SAVERMODE Ar int *mode
564 Set the screen saver mode. The argument
568 .Bl -tag -width CONS_LKM_SAVER -compact
571 .It Dv CONS_USR_SAVER
573 .It Dv CONS_LKM_SAVER
574 Add a new screen saver
577 .It Dv CONS_SAVERSTART Ar int *start
578 Start or stop the screen saver.
580 .It Dv PIO_FONT8x8 Ar fnt8_t *font
581 .It Dv GIO_FONT8x8 Ar fnt8_t *font
582 Get or set the 8x8 font. The
584 argument structure is defined as follows:
591 .It Dv PIO_FONT8x14 Ar fnt14_t *font
592 .It Dv GIO_FONT8x14 Ar fnt14_t *font
593 Get or set the 8x14 font. The
595 argument structure is defined as follows:
598 char fnt8x14[14*256];
602 .It Dv PIO_FONT8x16 Ar fnt16_t *font
603 .It Dv GIO_FONT8x16 Ar fnt16_t *font
604 Get or set the 8x16 font. The
606 argument structure is defined as follows:
609 char fnt8x16[16*256];
613 .It Dv CONS_GETINFO Ar vid_info_t *info
614 Get information about the current video mode. The
616 structure is defined as follows:
622 u_short mv_row, mv_col;
623 u_short mv_rsz, mv_csz;
624 struct colors mv_norm,
632 .It Dv CONS_GETVERS Ar int *version
633 Get the version of the driver.
635 .It Dv CONS_CURRENTADP Ar int *adapter
636 Get the video adapter index. This is equivalent to
639 .It Dv CONS_ADPINFO Ar video_adapter_info_t *info
640 Get the video adapter information. This is equivalent to
643 .It Dv CONS_MODEINFO Ar video_info_t *info
644 Get the video mode information. This is equivalent to
647 .It Dv CONS_FINDMODE Ar video_info_t *info
648 Find a video mode. This is equivalent to
651 .It Dv CONS_SETWINORG Ar u_int *origin
652 Set the frame buffer window origin. This is equivalent to
655 .It Dv CONS_SETKBD Ar int *kbd
659 Release the current keyboard.
661 .It Dv CONS_SCRSHOT Ar scrshot_t *data
662 Make a snapshot of the current video buffer. The
664 structure is defined as:
673 .It Dv CONS_GETTERM Ar term_info_t *info
674 .It Dv CONS_SETTERM Ar term_info_t *info
675 Get or set terminal characteristics. The
677 structure is defined as:
682 u_char ti_name[TI_NAME_LEN];
683 u_char ti_desc[TI_DESC_LEN];
687 .It Dv VT_OPENQRY Ar int *term
688 Get the next available terminal.
690 .It Dv VT_SETMODE Ar vtmode_t *mode
691 .It Dv VT_GETMODE Ar vtmode_t *mode
692 Get or set the terminal switching mode. The
694 argument structure is defined as follows:
705 .It Dv VT_RELDISP Ar int *ack
706 Acknowledge the release or acquisition of a terminal. The
708 argument can be one of:
710 .Bl -tag -width VT_ACKACQ -compact
712 The user refuses to release the screen, abort
714 The user has released the screen, go on
716 Acquisition of the screen acknowledged, switch completed
719 .It Dv VT_ACTIVATE Ar int *term
720 Activate the specified terminal.
722 .It Dv VT_WAITACTIVE Ar int *term
723 Wait until the specified terminal is active.
725 .It Dv VT_GETACTIVE Ar int *term
726 Get the currently active terminal.
728 .It Dv VT_GETINDEX Ar int *index
729 Get the index of the terminal.
731 .It Dv VT_LOCKSWITCH Ar int *lock
732 Prevent or permit terminal switching.
735 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
737 .It Pa /dev/consolectl
741 terminal initialization information
742 .It Pa /usr/share/syscons/fonts/*
744 .It Pa /usr/share/syscons/keymaps/*
746 .It Pa /usr/share/syscons/scrmaps/*
752 driver requires the keyboard driver and the video card driver,
753 the kernel configuration file should contain the following lines.
755 .D1 Cd device atkbdc0 at isa? port IO_KBD
756 .D1 Cd device atkbd0 at atkbdc? irq 1
757 .D1 Cd device vga0 at isa?
758 .D1 Cd device sc0 at isa?
759 .D1 Cd pseudo-device splash
761 If you do not intend to load the splash image or use the screen saver,
762 the last line is not necessary, and can be omitted.
764 Note that the keyboard controller driver
766 is required by the keyboard driver
769 The following lines will set the default colors.
770 The normal text will be green on black background.
771 The reversed text will be yellow on green background.
772 Note that you cannot put any white space inside the quoted string,
773 because of the current implementation of
776 .D1 Cd "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)"
777 .D1 Cd "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)"
779 The following lines will set the default colors of the kernel message.
780 The kernel message will be printed bright red on black background.
781 The reversed message will be black on red background.
783 .D1 Cd "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)"
784 .D1 Cd "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)"
786 The following line will set the default border color of the terminal.
787 If the console is in framebuffer mode, or in raster (pixel) text mode,
788 a thin green border will be visible around the terminal if the screen
789 size is not an exact multiple of the font size.
790 This border area can be much larger if the column or row count is
791 explicitly specified (for example when using the
795 .D1 Cd "options SC_BORDER_COLOR=FG_GREEN"
797 The following example adds the font files
804 .D1 Cd "options SC_DFLT_FONT"
805 .D1 Cd "makeoptions SC_DFLT_FONT=cp850"
806 .D1 Cd "device sc0 at isa?"
809 The amount of data that is possible to insert from the cut buffer is limited
812 a system limit on the number of bytes that may be stored in the terminal
813 input queue - usually 1024 bytes
838 driver first appeared in
844 driver was written by
845 .An S\(/oren Schmidt Aq Mt sos@FreeBSD.org .
846 This manual page was written by
847 .An Kazutaka Yokota Aq Mt yokota@FreeBSD.org
851 This manual page is incomplete and needs revision.