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_DFLT_FONT"
55 .Cd "makeoptions SC_DFLT_FONT=_font_name_"
56 .Cd "device sc0 at isa?" Op flags Ar flags
60 driver provides multiple virtual terminals.
61 It resembles the SCO color console driver.
65 driver is implemented on top of the keyboard driver
67 and the video card drivers
74 below on how to make the console work with
81 device defined in the system.
85 driver provides multiple virtual terminals which appear as if they were
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.
91 In order to use virtual terminals, they must be individually
96 will recognize them to be active and run
98 to let the user log in to the system.
99 By default, only the first eight virtual terminals are activated in
104 key and a switch key to switch between
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
117 You can also use the ``nscr'' key (usually the
119 key on the AT Enhanced keyboard) to cycle available virtual terminals.
121 The default number of available virtual terminals is 16.
122 This can be changed with the kernel configuration option
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
129 so that it can be used by the X server.
130 .Ss Key Definitions and Function Key Strings
133 driver, in conjunction with the keyboard driver, allows the user
134 to change key definitions and function key strings.
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.
145 You may want to set the
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.
152 For most modern video cards, e.g. VGA, the
154 driver and the video card driver allow the user to change
155 the font used on the screen.
158 command can be used to load a font file from
159 .Pa /usr/share/syscons/fonts .
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.
174 to the desired font files so that they will be automatically loaded
175 when the system starts up.
177 Optionally you can specify a particular font file as the default.
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.
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
192 and enable the mouse cursor in the virtual terminal via
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
199 You can press button 3 (usually the right button) to extend
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.
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.
216 driver allows the user to browse the output which has ``scrolled off''
217 the top of the screen.
219 Press the ``slock'' key (usually
225 on many keyboards) and the terminal is
226 in the ``scrollback'' mode.
227 It is indicated by the
230 Use the arrow keys, the
234 keys to scroll buffered terminal output.
235 Press the ``slock'' key again to get back to the normal terminal mode.
237 The size of the scrollback buffer can be set by the
239 option described below.
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.
251 .Sh DRIVER CONFIGURATION
253 The following tunable is available and can be set in
255 .Bl -tag -width ".Va kern.kms_console"
256 .It Va kern.kms_console
257 Setting this tunable to 1 enables experimental framebuffer support
258 in conjunction with the
264 .It Va kern.kms_columns
265 The number of columns to use in conjunction with the
270 The font size is scaled to match the requested number of columns.
276 tries to find a more or less pleasant looking default.
279 to a negative value turns off scaling.
281 .Ss Kernel Configuration Options
282 The following kernel configuration options control the
285 .Bl -tag -width MOUSE
287 This option sets the number of virtual terminals to
289 The default value is 16.
290 .It Dv SC_ALT_MOUSE_IMAGE
291 This option selects the alternative way of displaying the mouse cursor
292 in the virtual terminal.
293 It may be expensive for some video cards to draw the arrow-shaped
294 cursor, and you may want to try this option.
295 However, the appearance of the alternative mouse cursor may not be
297 Note that if you use the
298 .Dv SC_NO_FONT_LOADING
299 option then you must also use this option if you wish to be able to use
301 .It Dv SC_DISABLE_DDBKEY
302 This option disables the ``debug'' key combination (by default, it is
305 .Dv Ctl-PrintScreen ) .
306 It will prevent users from
307 entering the kernel debugger (DDB) by pressing the key combination.
308 DDB will still be invoked when the kernel panics or hits a break point
309 if it is included in the kernel.
310 .It Dv SC_DISABLE_REBOOT
311 This option disables the ``reboot'' key (by default, it is
313 so that the casual user may not accidentally reboot the system.
314 .It Dv SC_HISTORY_SIZE=N
315 Sets the size of back scroll buffer to
318 The default value is 100.
319 .It Dv SC_MOUSE_CHAR=C
321 .Dv SC_ALT_MOUSE_IMAGE
322 option above is specified, the
324 driver reserves four consecutive character codes in order to display the
325 mouse cursor in the virtual terminals in some systems.
326 This option specifies the first character code to
328 to be used for this purpose.
329 The default value is 0xd0.
330 A good candidate is 0x03.
332 Adds support for pixel (raster) mode console.
333 This mode is useful on some laptop computers, but less so on
334 most other systems, and it adds substantial amount of code to
336 If this option is NOT defined, you can reduce the kernel size a lot.
340 .It Dv SC_TWOBUTTON_MOUSE
341 If you have a two button mouse, you may want to add this option
342 to use the right button of the mouse to paste text.
344 .Sx Mouse Support and Copy-and-Paste
346 .It Dv SC_NORM_ATTR=_attribute_
347 .It Dv SC_NORM_REV_ATTR=_attribute_
348 .It Dv SC_KERNEL_CONS_ATTR=_attribute_
349 .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_
350 These options will set the default colors.
351 Available colors are defined in
352 .In machine/pc/display.h .
357 This option will specify the default font.
358 Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865,
360 16-line, 14-line and 8-line font data will be compiled in.
361 Without this option, the
363 driver will use whatever font is already loaded in the video card,
364 unless you explicitly load a software font at startup.
370 The following options will remove some features from the
372 driver and save kernel memory.
373 .Bl -tag -width MOUSE
374 .It Dv SC_NO_CUTPASTE
375 This option disables ``copy and paste'' operation in virtual
377 .It Dv SC_NO_FONT_LOADING
380 driver can load software fonts on some video cards.
381 This option removes this feature.
382 Note that if you still wish to use
383 the mouse with this option then you must also use the
384 .Dv SC_ALT_MOUSE_IMAGE
387 This option disables back-scrolling in virtual terminals.
388 .\".It Dv SC_NO_PALETTE_LOADING
389 .It Dv SC_NO_SYSMOUSE
390 This option removes mouse support in the
395 will fail if this option is defined.
396 This option implies the
401 The following driver flags can be used to control the
404 They can be set either in the kernel configuration file
407 or else in the User Configuration Menu at boot
411 .Bl -tag -width bit_0
412 .\".It bit 0 (VISUAL_BELL)
413 .\"Uses the ``visual'' bell.
414 .\"The screen will blink instead of generating audible sound.
415 .\".It bit 1,2 (CURSOR_TYPE)
416 .\"This option specifies the cursor appearance.
417 .\"Possible values are:
418 .\".Bl -tag -width TYPE -compact
420 .\"normal block cursor
422 .\"blinking block cursor
426 .\"blinking underline (aka destructive) cursor
428 .\".It bit 6 (QUIET_BELL)
429 .\"This option suppresses the bell, whether audible or visual,
430 .\"if it is rung in a background virtual terminal.
431 .It 0x0080 (VESA800X600)
432 This option puts the video card in the VESA 800x600 pixel, 16 color
434 It may be useful for laptop computers for which the 800x600 mode
435 is otherwise unsupported by the X server.
436 Note that in order for this flag to work, the kernel must be
439 option explained above.
440 .\"Note also that the ``copy-and-paste'' function is not currently supported
441 .\"in this mode and the mouse pointer will not be displayed.
442 .It 0x0100 (AUTODETECT_KBD)
443 This option instructs the
445 driver to periodically scan
446 for a keyboard device if it is not currently attached to one.
447 Otherwise, the driver only probes for a keyboard once during bootup.
452 commands are defined for the
457 .Bl -tag -width CONS -compact
458 .It Dv KDGETMODE Ar int *mode
459 .It Dv KDSETMODE Ar int *mode
460 Get or set the mode of the current (virtual) console. The
464 .Bl -tag -width KD_GRAPHICS -compact
469 Text mode, restore fonts and palette
473 Text mode, don't restore fonts and palette
475 Raster (pixel) text mode
478 .It Dv KDSBORDER Ar int *color
479 Set the border color of the current (virtual) console.
481 .It Dv KDRASTER Ar scr_size_t *sizes
482 Set raster (pixel) text mode and adjust the current (virtual) console's
483 geometry and font size. The
485 argument structure is as follows:
492 .It Dv GIO_SCRNMAP Ar scrmap_t *map
493 .It Dv PIO_SCRNMAP Ar scrmap_t *map
494 Get or set the screen map for the current (virtual) console. The
496 argument structure is defined as follows:
503 .It Dv GIO_ATTR Ar int *attr
504 Get the current text attribute.
506 .It Dv GIO_COLOR Ar int *color
507 Get the current text color.
509 .It Dv CONS_CURRENT Ar int *type
510 Get the adapter type. This is equivalent to
513 .It Dv CONS_GET Ar int *mode
514 Get the current video mode. This is equivalent to
517 .It Dv CONS_SET Ar int *mode
518 Set the current video mode. This is equivalent to
521 .It Dv CONS_BLANKTIME Ar int *time
522 Set the screen saver blank interval (in seconds).
524 .It Dv CONS_CURSORTYPE Ar int *type
525 Set the text cursor shape. The argument
527 can be one or more of the following:
529 .Bl -tag -width CONS_BLINK_CURSOR -compact
530 .It Dv CONS_BLINK_CURSOR
531 Set for a blinking cursor, unset for a non-blinking cursor.
532 .It Dv CONS_CHAR_CURSOR
533 Set for an underscore-shaped cursor, unset for a rectangle.
536 .It Dv CONS_BELLTYPE Ar int *type
537 Set the bell type. The argument
541 .Bl -tag -width CONS_VISUAL_BELL -compact
542 .It Dv CONS_VISUAL_BELL
543 Set for a visual bell, unset for an audible bell.
544 .It Dv CONS_QUIET_BELL
545 Set to enable the bell, unset to disable it.
548 .It Dv CONS_HISTORY Ar int *size
549 Set the history (scroll back) buffer size (in lines).
552 Clear the history (scroll back) buffer.
554 .It Dv CONS_IDLE Ar int *idle
555 Check if the (virtual) console has been idle.
557 .It Dv CONS_SAVERMODE Ar int *mode
558 Set the screen saver mode. The argument
562 .Bl -tag -width CONS_LKM_SAVER -compact
565 .It Dv CONS_USR_SAVER
567 .It Dv CONS_LKM_SAVER
568 Add a new screen saver
571 .It Dv CONS_SAVERSTART Ar int *start
572 Start or stop the screen saver.
574 .It Dv PIO_FONT8x8 Ar fnt8_t *font
575 .It Dv GIO_FONT8x8 Ar fnt8_t *font
576 Get or set the 8x8 font. The
578 argument structure is defined as follows:
585 .It Dv PIO_FONT8x14 Ar fnt14_t *font
586 .It Dv GIO_FONT8x14 Ar fnt14_t *font
587 Get or set the 8x14 font. The
589 argument structure is defined as follows:
592 char fnt8x14[14*256];
596 .It Dv PIO_FONT8x16 Ar fnt16_t *font
597 .It Dv GIO_FONT8x16 Ar fnt16_t *font
598 Get or set the 8x16 font. The
600 argument structure is defined as follows:
603 char fnt8x16[16*256];
607 .It Dv CONS_GETINFO Ar vid_info_t *info
608 Get information about the current video mode. The
610 structure is defined as follows:
616 u_short mv_row, mv_col;
617 u_short mv_rsz, mv_csz;
618 struct colors mv_norm,
626 .It Dv CONS_GETVERS Ar int *version
627 Get the version of the driver.
629 .It Dv CONS_CURRENTADP Ar int *adapter
630 Get the video adapter index. This is equivalent to
633 .It Dv CONS_ADPINFO Ar video_adapter_info_t *info
634 Get the video adapter information. This is equivalent to
637 .It Dv CONS_MODEINFO Ar video_info_t *info
638 Get the video mode information. This is equivalent to
641 .It Dv CONS_FINDMODE Ar video_info_t *info
642 Find a video mode. This is equivalent to
645 .It Dv CONS_SETWINORG Ar u_int *origin
646 Set the frame buffer window origin. This is equivalent to
649 .It Dv CONS_SETKBD Ar int *kbd
653 Release the current keyboard.
655 .It Dv CONS_SCRSHOT Ar scrshot_t *data
656 Make a snapshot of the current video buffer. The
658 structure is defined as:
667 .It Dv CONS_GETTERM Ar term_info_t *info
668 .It Dv CONS_SETTERM Ar term_info_t *info
669 Get or set terminal characteristics. The
671 structure is defined as:
676 u_char ti_name[TI_NAME_LEN];
677 u_char ti_desc[TI_DESC_LEN];
681 .It Dv VT_OPENQRY Ar int *term
682 Get the next available terminal.
684 .It Dv VT_SETMODE Ar vtmode_t *mode
685 .It Dv VT_GETMODE Ar vtmode_t *mode
686 Get or set the terminal switching mode. The
688 argument structure is defined as follows:
699 .It Dv VT_RELDISP Ar int *ack
700 Acknowledge the release or acquisition of a terminal. The
702 argument can be one of:
704 .Bl -tag -width VT_ACKACQ -compact
706 The user refuses to release the screen, abort
708 The user has released the screen, go on
710 Acquisition of the screen acknowledged, switch completed
713 .It Dv VT_ACTIVATE Ar int *term
714 Activate the specified terminal.
716 .It Dv VT_WAITACTIVE Ar int *term
717 Wait until the specified terminal is active.
719 .It Dv VT_GETACTIVE Ar int *term
720 Get the currently active terminal.
722 .It Dv VT_GETINDEX Ar int *index
723 Get the index of the terminal.
725 .It Dv VT_LOCKSWITCH Ar int *lock
726 Prevent or permit terminal switching.
729 .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact
731 .It Pa /dev/consolectl
735 terminal initialization information
736 .It Pa /usr/share/syscons/fonts/*
738 .It Pa /usr/share/syscons/keymaps/*
740 .It Pa /usr/share/syscons/scrmaps/*
746 driver requires the keyboard driver and the video card driver,
747 the kernel configuration file should contain the following lines.
749 .D1 Cd device atkbdc0 at isa? port IO_KBD
750 .D1 Cd device atkbd0 at atkbdc? irq 1
751 .D1 Cd device vga0 at isa?
752 .D1 Cd device sc0 at isa?
753 .D1 Cd pseudo-device splash
755 If you do not intend to load the splash image or use the screen saver,
756 the last line is not necessary, and can be omitted.
758 Note that the keyboard controller driver
760 is required by the keyboard driver
763 The following lines will set the default colors.
764 The normal text will be green on black background.
765 The reversed text will be yellow on green background.
766 Note that you cannot put any white space inside the quoted string,
767 because of the current implementation of
770 .D1 Cd "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK)"
771 .D1 Cd "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN)"
773 The following lines will set the default colors of the kernel message.
774 The kernel message will be printed bright red on black background.
775 The reversed message will be black on red background.
777 .D1 Cd "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK)"
778 .D1 Cd "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED)"
780 The following example adds the font files
787 .D1 Cd "options SC_DFLT_FONT"
788 .D1 Cd "makeoptions SC_DFLT_FONT=cp850"
789 .D1 Cd "device sc0 at isa?"
792 The amount of data that is possible to insert from the cut buffer is limited
795 a system limit on the number of bytes that may be stored in the terminal
796 input queue - usually 1024 bytes
821 driver first appeared in
827 driver was written by
828 .An S\(/oren Schmidt Aq Mt sos@FreeBSD.org .
829 This manual page was written by
830 .An Kazutaka Yokota Aq Mt yokota@FreeBSD.org
834 This manual page is incomplete and needs revision.