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