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.\" $Id: syscons.4,v 1.1 1999/02/10 14:25:03 yokota Exp $ 28.\" 29.Dd February 9, 1999 30.Dt SYSCONS 4 31.Os FreeBSD 32.Sh NAME 33.Nm syscons , 34.Nm sc 35.Nd 36the console driver 37.Sh SYNOPSIS 38.Cd "options" \&"MAXCONS=N\&" 39.\".Cd "options" \&"SC_ALT_MOUSE_IMAGE\&" 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" \&"STD8X16FONT\&" 49.Cd "makeoptions" \&"STD8X16FONT\&"=\&"_font_name_\&" 50.Cd "device sc0 at isa?" 51.Sh DESCRIPTION 52The 53.Nm 54driver provides multiple virtual terminals. 55It resembles the SCO color console driver. 56.Pp 57The 58.Nm 59driver is implemented on top of the keyboard driver 60.Pq Xr atkbd 4 61and the video card driver 62.Pq Xr vga 4 63and so requires both of them to be configured in the system. 64.Pp 65There can be only one 66.Nm 67device defined in the system. 68.Ss Virtual Terminals 69The 70.Nm 71driver provides multiple virtual terminals which appear as if they were 72separate terminals. 73One virtual terminal is considered current and exclusively 74occupies the screen and the keyboard; the other virtual terminals 75are placed in the background. 76.Pp 77In order to use virtual terminals, they must be individually 78marked ``on'' in 79.Pa /etc/ttys 80so that 81.Xr getty 8 82will recognize them to be active and run 83.Xr login 1 84to let the user to login to the system. 85By default, only the first three virtual terminals are activated in 86.Pa /etc/ttys . 87.Pp 88You press the 89.Em Alt 90key and a switch key to switch between 91virtual terminals. 92The following table summarizes the correspondence between the switch 93key and the virtual terminal. 94.Bd -literal -offset indent 95Alt-F1 ttyv0 Alt-F7 ttyv6 Shift-Alt-F1 ttyv10 96Alt-F2 ttyv1 Alt-F8 ttyv7 Shift-Alt-F2 ttyv11 97Alt-F3 ttyv2 Alt-F9 ttyv8 Shift-Alt-F3 ttyv12 98Alt-F4 ttyv3 Alt-F10 ttyv9 Shift-Alt-F4 ttyv13 99Alt-F5 ttyv4 Alt-F11 ttyv10 Shift-Alt-F5 ttyv14 100Alt-F6 ttyv5 Alt-F12 ttyv11 Shift-Alt-F6 ttyv15 101.Ed 102.Pp 103You can also use the ``nscr'' key (usually the 104.Em PrintScreen 105key on the AT Enhanced keyboard) to cycle available virtual terminals. 106.Pp 107The default number of available virtual terminals is 16. 108This can be changed by the kernel configuration option 109.Em MAXCONS 110(see below). 111.Pp 112Note that the X server usually requires a virtual terminal for display 113purposes, so at least one terminal must be left unused by 114.Xr getty 8 115so that it can be used by the X server. 116.Ss Key Definitions and Function Key Strings 117The 118.Nm 119driver, in conjunction with the keyboard driver, allows the user 120to change key definitions and function key strings. 121The 122.Xr kbdcontrol 1 123command will load a key definition file (known as ``keymap'' file), 124dump the current keymap, and assign a string to a function key. 125See 126.Xr keyboard 4 127and 128.Xr keymap 5 129for the keymap file. 130.Pp 131You may want to set the 132.Ar keymap 133variable in 134.Pa /etc/rc.conf 135to the desired keymap file so that it will be automatically loaded 136when the system starts up. 137.Ss Software Font 138For most modern video cards, e.g. VGA, the 139.Nm 140driver and the video card driver allow the user to change 141the font used on the screen. 142The 143.Xr vidcontrol 1 144command can be used to load a font file from 145.Pa /usr/share/syscons/fonts . 146.Pp 147The font comes in various sizes: 8x8, 8x14 and 8x16. 148The 8x16 font is typically used for the VGA card in the 80-column- 149by-25-line mode. 150Other video modes may require different size of font. 151It is better to always load these three sizes of the same font. 152.Pp 153You may set 154.Ar font8x8 , 155.Ar font8x14 156and 157.Ar font8x16 158variables in 159.Pa /etc/rc.conf 160to the desired font files so that they will be automatically loaded 161when the system starts up. 162.Pp 163Optionally you can make a particular font file as the default 8x16 font. 164See the 165.Em STD8X16FONT 166option below. 167.Ss Screen Map 168If your video card does not support software font, you may still be able 169to have similar effect by re-mapping font hard-wired in the video card. 170Use 171.Xr vidcontrol 1 172to load a screen map file which defines mapping between character codes. 173.Ss Mouse Support and Copy-and-Paste 174You can use your mouse to copy text on the screen and paste it as if 175it is typed by hand. 176You must be running the mouse daemon 177.Xr moused 8 178and enable the mouse cursor in the virtual terminal via 179.Xr vidcontrol 1 . 180.Pp 181Pressing the mouse button 1 (usually the left button) will start selection. 182Releasing the button 1 will end the selection process. 183The selected text will be marked by inverting foreground and 184background colors. 185You can press the button 3 (usually the right button) to extend 186the selected region. 187The selected text is placed in the copy buffer and can be pasted 188at the cursor position by your pressing the button 2 (usually the 189middle button) as many times as you like. 190.Ss Back Scrolling 191The 192.Nm 193driver allows the user to browse the output which has ``scrolled off'' 194from the top of the screen. 195.Pp 196Press the ``slock'' key (usually 197.Em ScrllLock 198and/or 199.Em Pause 200keys on many AT Enhanced keyboards) and the terminal is 201in the ``back scrolling'' mode. 202It is indicated by the 203.Em Scroll Lock 204LED. 205Use arrow keys, 206.Em Page Up/Down 207keys and 208.Em Home/End 209keys to scroll buffered terminal output. 210Press the ``slock'' key again to get back to the normal terminal mode. 211.Pp 212The size of the back-scroll buffer can be set by the 213.Em SC_HISTORY_SIZE 214option below. 215.Ss Screen Saver 216The 217.Nm 218driver can be made to put up the screen saver if the current 219virtual terminal is idle, that is, the user is not typing 220on the keyboard nor moving mouse. 221See 222.Xr splash 4 223and 224.Xr vidcontrol 1 225for more details. 226.Sh DRIVER CONFIGURATION 227.Ss Kernel Configuration Options 228The following kernel configuration options control the 229.Nm 230driver. 231.Bl -tag -width MOUSE 232.It Em MAXCONS=N 233This option sets the number of virtual terminals to 234.Fa N . 235The default value is 16. 236.\".It Em SC_ALT_MOUSE_IMAGE 237.\"This option selects the alternative way of displaying the mouse cursor 238.\"in the virtual terminal. 239.\"It may be vastly costly for some video cards to draw the arrow-shaped 240.\"cursor and you may want to try this option. 241.\"However, the appearance of the alternative mouse cursor may not be 242.\"very appealing. 243.It Em SC_DISABLE_REBOOT 244This option disables the ``reboot'' key (by default, it is 245.Em Ctl-Alt-Del ), 246so that the casual user may not accidentally reboot the system. 247.It Em SC_HISTORY_SIZE=N 248Sets the size of back scroll buffer to 249.Fa N 250lines. 251The default value is 100. 252.It Em SC_MOUSE_CHAR=C 253.\"Unless the 254.\".Em SC_ALT_MOUSE_IMAGE 255.\"option above is specified, the 256The 257.Nm 258driver reserves four consecutive character codes in order to display the 259mouse cursor in the virtual terminals in some systems. 260This option specifies the first character code to 261.Fa C 262to be used for this purpose. 263The default value is 0xd0. 264A good candidate is 0x03. 265.\".It Em SC_PIXEL_MODE 266.It Em STD8X16FONT 267This option will specify the default 8x16 font. 268Without this option, the 269.Nm 270driver will use whatever font already loaded in the video card, 271unless you explicitly load software font at startup. 272See 273.Sx EXAMPLE 274below. 275.El 276.\".Pp 277.\"The following options will remove some features from the 278.\".Nm 279.\"driver and save kernel memory. 280.\".Bl -tag -width MOUSE 281.\".It Em SC_NO_CUTPASTE 282.\"This option disables ``copy and paste'' operation in virtual 283.\"terminals. 284.\".It Em SC_NO_FONT_LOADING 285.\"The 286.\".Nm 287.\"driver can load software font on some video cards. 288.\"This option removes this feature. 289.\".It Em SC_NO_HISTORY 290.\"This option disables back-scrolling in virtual terminals. 291.\".It Em SC_NO_SYSMOUSE 292.\"This option removes mouse support in the 293.\".Nm 294.\"driver. 295.\"The mouse daemon 296.\".Xr moused 8 297.\"will fail if this option is defined. 298.\"This option implies the 299.\".Em SC_NO_CUTPASTE 300.\"option too. 301.\".El 302.Ss Driver Flags 303The following driver flags can be used to control the 304.Nm 305driver. 306They can be set either in the kernel configuration file 307.Pq see Xr config 8 , 308or else in the User Configuration Menu at boot 309time 310.Pq see Xr boot 8 . 311.Bl -tag -width bit_0 312.It bit 0 (VISUAL_BELL) 313Uses the ``visual'' bell. 314The screen will blink instead of generating audible sound. 315.It bit 1,2 (CURSOR_TYPE) 316This option specifies the cursor appearance. 317Possible values are: 318.Bl -tag -width TYPE -compact 319.It Em 0 320normal block cursor 321.It Em 2 322blinking block cursor 323.It Em 4 324underline cursor 325.It Em 6 326blinking underline (aka destructive) cursor 327.El 328.It bit 6 (QUIET_BELL) 329This option suppresses the bell, whether audible or visual, 330if it is rung in a background virtual terminal. 331.It bit 7 (VESA800X600) 332This option puts the video card in the VESA 800x600 dots, 16 color 333mode. 334It may be useful for laptop computers for which the 800x600 mode 335is otherwise unsupported by the X server. 336Note that the ``copy-and-paste'' function is not currently supported in 337this mode and the mouse pointer will not be displayed. 338.El 339.Sh FILES 340.Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact 341.It Pa /dev/console 342.It Pa /dev/consolectl 343.It Pa /dev/ttyv? 344virtual terminals 345.It Pa /etc/ttys 346terminal initialization information 347.It Pa /usr/share/syscons/fonts/* 348font files 349.It Pa /usr/share/syscons/keymaps/* 350key map files 351.It Pa /usr/share/syscons/scrmaps/* 352screen map files 353.El 354.Sh EXAMPLE 355As the 356.Nm 357driver requires the keyboard driver and the video card driver, 358the kernel configuration file should contain the following lines. 359.Pp 360.Bd -literal -offset indent 361device atkbdc0 at isa? port IO_KBD 362device atkbd0 at atkbdc? irq 1 363device vga0 at isa? conflicts 364device sc0 at isa? 365 366pseudo-device splash 367.Ed 368.Pp 369If you do not intend to load the splash image or use the screen saver, 370the last line is not necessary, and can be omitted. 371.Pp 372Note that the keyboard controller driver 373.Nm atkbdc 374is required by the keyboard driver 375.Nm atkbd . 376.Pp 377The following example adds the font file 378.Pa /usr/share/syscons/fonts/cp850-8x16.fnt 379to the kernel as the default 8x16 font. 380.Pp 381.Dl "options" \&"STD8X16FONT\&" 382.Dl "makeoptions" \&"STD8X16FONT\&"=\&"cp850\&" 383.Dl "device sc0 at isa? 384.Pp 385.\".Sh DIAGNOSTICS 386.\".Sh CAVEATS 387.Sh BUGS 388This manual page is incomplete and urgently needs revision. 389.Sh SEE ALSO 390.Xr kbdcontrol 1 , 391.Xr kldload 1 , 392.Xr login 1 , 393.Xr vidcontrol 1 , 394.Xr atkbd 4 , 395.Xr atkbdc 4 , 396.Xr keyboard 4 , 397.Xr screen 4 , 398.Xr splash 4 , 399.Xr vga 4 , 400.Xr keymap 5 , 401.Xr rc.conf 5 , 402.Xr screenmap 5 , 403.Xr ttys 5 , 404.Xr config 8 , 405.Xr getty 8 , 406.Xr moused 8 . 407.Sh HISTORY 408The 409.Nm 410driver first appeared in 411.Fx 1.0 . 412.Sh AUTHORS 413The 414.Nm 415driver was written by 416.An S�ren Schmidt Aq sos@FreeBSD.org . 417This manual page was written by 418.An Kazutaka Yokota Aq yokota@FreeBSD.org . 419