1.\" $NetBSD: wscons.4,v 1.37 2018/01/13 23:43:46 wiz 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 "wsdisplay* at ..." 35.Cd "wskbd* at ... mux N" 36.Cd "wsmouse* at ... mux N" 37.Pp 38.Cd pseudo-device wsmux 39.Pp 40.Cd options WSEMUL_SUN 41.Cd options WSEMUL_VT100 42.Cd options WSEMUL_NO_DUMB 43.Cd options WSEMUL_DEFAULT=\*qxxx\*q 44.Pp 45.Cd options WS_DEFAULT_FG=WSCOL_XXX 46.Cd options WS_DEFAULT_BG=WSCOL_XXX 47.Cd options WS_DEFAULT_COLATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 48.Cd options WS_DEFAULT_MONOATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 49.Cd options WS_KERNEL_FG=WSCOL_XXX 50.Cd options WS_KERNEL_BG=WSCOL_XXX 51.Cd options WS_KERNEL_COLATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 52.Cd options WS_KERNEL_MONOATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 53.Pp 54.Cd options WSDISPLAY_COMPAT_PCVT 55.Cd options WSDISPLAY_COMPAT_SYSCONS 56.Cd options WSDISPLAY_COMPAT_USL 57.Cd options WSCOMPAT_USL_SYNCTIMEOUT=nnn 58.Cd options WSDISPLAY_COMPAT_RAWKBD 59.Pp 60.Cd options WSKBD_EVENT_AUTOREPEAT 61.Cd options WSKBD_USONLY 62.Sh DESCRIPTION 63The 64.Nm 65driver provides support for machine independent access to the console. 66.Pp 67.Nm 68is made of a number of cooperating modules, in particular 69.Bl -bullet 70.It 71hardware support for display adapters, keyboards and mice, see 72.Xr wsdisplay 4 , 73.Xr wskbd 4 , 74and 75.Xr wsmouse 4 76.It 77input event multiplexor, see 78.Xr wsmux 4 79.It 80terminal emulation modules (see below), and 81.It 82compatibility options to support control operations and other low-level 83behaviour of existing terminal drivers (see below) 84.El 85.Ss Terminal emulations 86.Nm 87does not define its own set of terminal control sequences and special keyboard 88codes in terms of 89.Xr terminfo 5 . 90Instead a 91.Dq terminal emulation 92is assigned to each virtual screen when the screen is created. 93(See 94.Xr wsconscfg 8 . ) 95Different terminal emulations can be active at the same time on one display. 96The following choices are available: 97.Bl -tag -width xxxxxx 98.It dumb 99This minimal terminal support is available unless the kernel option 100.Cd options WSEMUL_NO_DUMB 101was specified at build time. 102No control sequences are supported besides the ASCII control characters. 103The cursor is not addressable. 104Only 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. 112It supports the control sequences of 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 DEC VT100 120terminals with some extensions introduced by the DEC VT220 121and DEC VT320 models. 122The features of the original VT100 123which are not or not completely implemented are: 124.Bl -bullet 125.It 126VT52 support, 132-column-mode, smooth scroll, light background, keyboard 127autorepeat control, external printer support, keyboard locking, 128newline/linefeed switching: Escape sequences related 129to these features are ignored or answered with standard replies. 130(DECANM, DECCOLM, DECSCLM, DECSCNM, DECARM, DECPFF, DECPEX, KAM, LNM) 131.It 132Function keys are not reprogrammable and fonts can not be downloaded. 133DECUDK and DECDLD sequences will be ignored. 134.It 135Neither C1 control set characters will be recognized nor will 8-bit keyboard 136codes be delivered. 137.It 138The 139.Dq DEC supplemental graphic 140font is approximated by the ISO-latin-1 font, though there are 141subtle differences. 142.It 143The actual rendering quality depends on the underlying graphics hardware 144driver. 145Characters might be missing in the available fonts and be 146substituted by more or less fitting replacements. 147.Pp 148Depending on the keyboard used, not all function keys might be available. 149.El 150.Pp 151In addition to the plain VT100 functions are supported: 152.Bl -bullet 153.It 154ANSI colors. 155.It 156Some VT220-like presentation state settings and -reports (DECRSPS), especially 157tabulator settings. 158.El 159.Pp 160In most applications, 161.Nm 162will work sufficiently as a VT220 emulator. 163.El 164.Pp 165The 166.Dv WSEMUL_DEFAULT 167kernel option is used to select one of the described terminal options 168as the default choice. 169The default takes effect at kernel startup, i.e. for the operating 170system console or additional screens allocated through the 171.Dv WSDISPLAY_DEFAULTSCREENS 172option (see 173.Xr wsdisplay 4 ) , 174or if no emulation type was passed to the 175.Xr wsconscfg 8 176utility. 177.Ss Compatibility options 178These options allow X servers and other programs using low-level 179console driver functions usually written specifically for other 180console drivers to run on 181.Nx 182systems. 183The options are in particular: 184.Bl -tag -width xxxxxxxx 185.It Cd WSDISPLAY_COMPAT_USL 186Support the protocol for switches between multiple virtual screens on 187one display as used by most PC-UNIX variants. 188This is used by the 189.Nx 190.Xr wsconscfg 8 191utility. 192.It Cd WSDISPLAY_COMPAT_RAWKBD 193Allows to get raw XT keyboard scancodes from PC keyboards as needed 194by i386 X servers. 195.It Cd WSDISPLAY_COMPAT_PCVT 196Emulates enough of the 197.Nx Ns /i386 198.Dq pcvt 199driver to make X servers work. 200.It Cd WSDISPLAY_COMPAT_SYSCONS 201Emulates enough of the 202.Fx 203.Dq syscons 204driver to make X servers work. 205Useful with 206.Fx 207binary emulation. 208.El 209.Pp 210Linux/i386 X servers usually run successfully if the first two options are 211enabled together with the 212.Nx 213Linux binary emulation. 214.Pp 215(To have programs looking for device special files of other console drivers 216find the 217.Nm 218driver entry points, symlinks are a helpful measure.) 219.Ss Other options 220.Bl -tag -width xxxxxxxx -compact 221.It Cd options WS_DEFAULT_FG=WSCOL_XXX 222.It Cd options WS_DEFAULT_BG=WSCOL_XXX 223.It Cd options WS_DEFAULT_COLATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 224.It Cd options WS_DEFAULT_MONOATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 225Make default console output appear in specific colors and attributes. 226.Dv WS_DEFAULT_FG 227and 228.Dv WS_DEFAULT_BG 229set the foreground and background used on color displays. 230.Dv WS_DEFAULT_COLATTR 231and 232.Dv WS_DEFAULT_MONOATTR 233are additional attribute flags used on color or monochrome displays, 234respectively. 235Whether the attributes 236are supported or not depends on the actually used graphics adapter. 237These options are ignored by the 238.Dq dumb 239terminal emulation. 240.Pp 241See 242.Pa src/sys/dev/wscons/wsdisplayvar.h 243for available 244.Dv WSCOL_XXX 245and 246.Dv WSATTR_XXX 247values. 248.Pp 249.It Cd options WS_KERNEL_FG=WSCOL_XXX 250.It Cd options WS_KERNEL_BG=WSCOL_XXX 251.It Cd options WS_KERNEL_COLATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 252.It Cd options WS_KERNEL_MONOATTR=\*q(WSATTR_XXX\ |\ WSATTR_YYY)\*q 253Make console output originating from the kernel appear differently 254than output from user level programs (via 255.Pa /dev/console 256or the specific tty 257device like 258.Pa /dev/ttyE0 ) . 259Their meaning is the same as their 260.Dv WS_DEFAULT_* 261counterparts. 262.Pp 263.It Cd options WSCOMPAT_USL_SYNCTIMEOUT=nnn 264The virtual screen switching protocol enabled by 265.Dv WSDISPLAY_COMPAT_USL 266uses a somewhat complex handshake protocol to pass control to user programs 267such as X servers controlling a virtual screen. 268In order to prevent a non-responsive 269application from locking the whole console system, 270a screen switch will be rolled 271back after a 5 second timeout if the application does not respond. 272This option can be used to specify in seconds a different timeout value. 273.Pp 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.Pp 278.It Cd options WSKBD_USONLY 279In order to strip down the space usage of wscons, 280all keymaps except the US english one can be removed from the kernel 281with this option, which results in a space gain of about 10kB. 282.El 283.Sh SEE ALSO 284.Xr wsdisplay 4 , 285.Xr wskbd 4 , 286.Xr wsmouse 4 , 287.Xr wsmux 4 , 288.Xr wsconscfg 8 , 289.Xr wsconsctl 8 , 290.Xr wsfontload 8 , 291.Xr wscons 9 292