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