1.\" $NetBSD: wscons.4,v 1.32 2016/08/27 23:59:56 dholland Exp $ 2.\" 3.\" Copyright (c) 1999, 2004 The NetBSD Foundation, Inc. 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. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25.\" POSSIBILITY OF SUCH DAMAGE. 26.\" 27.Dd June 5, 2012 28.Dt WSCONS 4 29.Os 30.Sh NAME 31.Nm wscons 32.Nd workstation console access 33.Sh SYNOPSIS 34.Cd options WSEMUL_SUN 35.Cd options WSEMUL_VT100 36.Cd options WSEMUL_NO_DUMB 37.Cd options WSEMUL_DEFAULT=\&"xxx\&" 38.Cd options WS_DEFAULT_FG=WSCOL_XXX 39.Cd options WS_DEFAULT_BG=WSCOL_XXX 40.Cd options WS_DEFAULT_COLATTR=\&"(WSATTR_XXX | WSATTR_YYY)" 41.Cd options WS_DEFAULT_MONOATTR=\&"(WSATTR_XXX | WSATTR_YYY)" 42.Cd options WS_KERNEL_FG=WSCOL_XXX 43.Cd options WS_KERNEL_BG=WSCOL_XXX 44.Cd options WS_KERNEL_COLATTR=\&"(WSATTR_XXX | WSATTR_YYY)" 45.Cd options WS_KERNEL_MONOATTR=\&"(WSATTR_XXX | WSATTR_YYY)" 46.Cd options WSCOMPAT_USL_SYNCTIMEOUT=nnn 47.Cd options WSDISPLAY_COMPAT_PCVT 48.Cd options WSDISPLAY_COMPAT_SYSCONS 49.Cd options WSDISPLAY_COMPAT_USL 50.Cd options WSDISPLAY_COMPAT_RAWKBD 51.Cd options WSKBD_EVENT_AUTOREPEAT 52.Cd options WSKBD_USONLY 53.Pp 54.Cd "wsdisplay* at ..." 55.Cd "wskbd* at ... mux N" 56.Cd "wsmouse* at ... mux N" 57.Pp 58.Cd pseudo-device wsmux N 59.Sh DESCRIPTION 60The 61.Nm 62driver provides support for machine independent access to the console. 63.Pp 64.Nm 65is made of a number of cooperating modules, in particular 66.Bl -bullet 67.It 68hardware support for display adapters, keyboards and mice, see 69.Xr wsdisplay 4 , 70.Xr wskbd 4 , 71and 72.Xr wsmouse 4 73.It 74input event multiplexor, see 75.Xr wsmux 4 76.It 77terminal emulation modules (see below), and 78.It 79compatibility options to support control operations and other low-level 80behaviour of existing terminal drivers (see below) 81.El 82.Ss Terminal emulations 83.Nm 84does not define its own set of terminal control sequences and special keyboard 85codes in terms of 86.Xr terminfo 5 . 87Instead a 88.Dq terminal emulation 89is assigned to each virtual screen when the screen is created. 90(See 91.Xr wsconscfg 8 . ) 92Different terminal emulations can be active at the same time on one display. 93The following choices are available: 94.Bl -tag -width xxxxxx 95.It dumb 96This minimal terminal support is available unless the kernel option 97.Cd options WSEMUL_NO_DUMB 98was specified at build time. 99No control sequences are supported besides the ASCII control characters. 100The cursor is not addressable. 101Only ASCII 102keyboard codes will be delivered, cursor and functions keys do not work. 103.It sun 104The 105.Dq sun 106console emulation is available if 107.Cd options WSEMUL_SUN 108was specified at kernel build time. 109It supports the control sequences of 110.Tn SUN 111machine consoles and delivers its keyboard codes for function and 112keypad keys in use. 113This emulation is sufficient for full-screen applications. 114.It vt100 115is available with the kernel compile option 116.Cd options WSEMUL_VT100 . 117It provides the most commonly used functions of 118.Tn DEC VT100 119terminals with some extensions introduced by the 120.Tn DEC VT220 121and 122.Tn DEC VT320 123models. 124The features of the original 125.Tn VT100 126which are not or not completely implemented are: 127.Bl -bullet 128.It 129.Tn VT52 130support, 132-column-mode, smooth scroll, light background, keyboard 131autorepeat control, external printer support, keyboard locking, 132newline/linefeed switching: Escape sequences related 133to these features are ignored or answered with standard replies. 134(DECANM, DECCOLM, DECSCLM, DECSCNM, DECARM, DECPFF, DECPEX, KAM, LNM) 135.It 136Function keys are not reprogrammable and fonts can not be downloaded. 137DECUDK and DECDLD sequences will be ignored. 138.It 139Neither C1 control set characters will be recognized nor will 8-bit keyboard 140codes be delivered. 141.It 142The 143.Dq DEC supplemental graphic 144font is approximated by the ISO-latin-1 font, though there are 145subtle differences. 146.It 147The actual rendering quality depends on the underlying graphics hardware 148driver. 149Characters might be missing in the available fonts and be 150substituted by more or less fitting replacements. 151.Pp 152Depending on the keyboard used, not all function keys might be available. 153.El 154.Pp 155In addition to the plain 156.Tn VT100 157functions are supported: 158.Bl -bullet 159.It 160ANSI colors. 161.It 162Some 163.Tn VT220 164-like presentation state settings and -reports (DECRSPS), especially 165tabulator settings. 166.El 167.Pp 168In most applications, 169.Nm 170will work sufficiently as a 171.Tn VT220 172emulator. 173.El 174.Pp 175The 176.Va WSEMUL_DEFAULT 177kernel option is used to select one of the described terminal options 178as the default choice. 179The default takes effect at kernel startup, i.e. for the operating 180system console or additional screens allocated through the 181.Va WSDISPLAY_DEFAULTSCREENS 182option (see 183.Xr wsdisplay 4 ) , 184or if no emulation type was passed to the 185.Xr wsconscfg 8 186utility. 187.Ss Compatibility options 188these options allow X servers and other programs using low-level 189console driver functions usually written specifically for other 190console drivers to run on 191.Nx 192systems. 193The options are in particular: 194.Bl -tag -width xxxxxxxx 195.It Cd WSDISPLAY_COMPAT_USL 196Support the protocol for switches between multiple virtual screens on 197one display as used by most PC-UNIX variants. 198This is used by the 199.Nx 200.Xr wsconscfg 8 201utility. 202.It Cd WSDISPLAY_COMPAT_RAWKBD 203Allows to get raw XT keyboard scancodes from PC keyboards as needed 204by i386 X servers. 205.It Cd WSDISPLAY_COMPAT_PCVT 206Emulates enough of the 207.Nx Ns /i386 208.Dq pcvt 209driver to make X servers work. 210.It Cd WSDISPLAY_COMPAT_SYSCONS 211Emulates enough of the 212.Fx 213.Dq syscons 214driver to make X servers work. 215Useful with 216.Fx 217binary emulation. 218.El 219.Pp 220Linux/i386 X servers usually run successfully if the first two options are 221enabled together with the 222.Nx 223Linux binary emulation. 224.Pp 225(To have programs looking for device special files of other console drivers 226find the 227.Nm 228driver entry points, symlinks are a helpful measure.) 229.Ss Other options 230.Bl -tag -width xxxxxxxx 231.It Cd options WS_DEFAULT_FG=WSCOL_XXX , 232.It Cd options WS_DEFAULT_BG=WSCOL_XXX , 233.It Cd options \&WS_DEFAULT_COLATTR="(WSATTR_XXX | WSATTR_YYY)" 234and 235.It Cd options \&WS_DEFAULT_MONOATTR="(WSATTR_XXX | WSATTR_YYY)" 236allow to make default console output appear in specific colors and 237attributes. 238.Dq WS_DEFAULT_FG 239and 240.Dq WS_DEFAULT_BG 241set the foreground / background used on color displays. 242The 243.Dq WSCOL_XXX 244arguments are colors as defined in 245.Pa src/sys/dev/wscons/wsdisplayvar.h . 246.Dq WS_DEFAULT_COLATTR 247and 248.Dq WS_DEFAULT_MONOATTR 249are additional attribute flags used on color or monochrome displays, 250respectively. 251The arguments are defined in the same header file. 252Whether the attributes 253are supported or not depends on the actually used graphics adapter. 254These options are ignored by the 255.Dq dumb 256terminal emulation. 257.It Cd options WS_KERNEL_FG=WSCOL_XXX , 258.It Cd options WS_KERNEL_BG=WSCOL_XXX , 259.It Cd options \&WS_KERNEL_COLATTR="(WSATTR_XXX | WSATTR_YYY)" 260and 261.It Cd options \&WS_KERNEL_MONOATTR="(WSATTR_XXX | WSATTR_YYY)" 262allow to make console output originating from the kernel appear differently 263than output from user level programs (via 264.Pa /dev/console 265or the specific tty 266device like 267.Pa /dev/ttyE0 ) . 268Their meaning is the same as their 269.Sq WS_DEFAULT_* 270counterparts. 271.It Cd options WSCOMPAT_USL_SYNCTIMEOUT=nnn 272The virtual screen switching protocol enabled by 273.Dq WSDISPLAY_COMPAT_USL 274uses a somewhat complex handshake protocol to pass control to user programs 275such as X servers controlling a virtual screen. 276In order to prevent a non-responsive 277application from locking the whole console system, 278a screen switch will be rolled 279back after a 5 second timeout if the application does not respond. 280This option can be used to specify in seconds a different timeout value. 281.It Cd options WSKBD_EVENT_AUTOREPEAT 282If set, this option enables auto repeat even in event mode. 283The auto repeat will generate key down events while the key is pressed. 284.It Cd options WSKBD_USONLY 285In order to strip down the space usage of wscons, 286all keymaps except the US english one can be removed from the kernel 287with this option, which results in a space gain of about 10kB. 288.El 289.Sh SEE ALSO 290.Xr wsdisplay 4 , 291.Xr wskbd 4 , 292.Xr wsmouse 4 , 293.Xr wsmux 4 , 294.Xr wsconscfg 8 , 295.Xr wsconsctl 8 , 296.Xr wsfontload 8 , 297.Xr wscons 9 298