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