| 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 | .\" $FreeBSD: src/share/man/man4/syscons.4,v 1.10.2.14 2003/04/25 21:21:36 brueffer Exp $ |
| 28 | .\" $DragonFly: src/share/man/man4/syscons.4,v 1.6 2006/05/26 19:39:39 swildner Exp $ |
| 29 | .\" |
| 30 | .Dd January 28, 2005 |
| 31 | .Dt SYSCONS 4 |
| 32 | .Os |
| 33 | .Sh NAME |
| 34 | .Nm syscons , |
| 35 | .Nm sc |
| 36 | .Nd the console driver |
| 37 | .Sh SYNOPSIS |
| 38 | .Cd "options MAXCONS=N" |
| 39 | .Cd "options SC_ALT_MOUSE_IMAGE" |
| 40 | .Cd "options SC_DISABLE_DDBKEY" |
| 41 | .Cd "options SC_DISABLE_REBOOT" |
| 42 | .Cd "options SC_HISTORY_SIZE=N" |
| 43 | .Cd "options SC_MOUSE_CHAR=C" |
| 44 | .Cd "options SC_NO_CUTPASTE" |
| 45 | .Cd "options SC_NO_FONT_LOADING" |
| 46 | .Cd "options SC_NO_HISTORY" |
| 47 | .Cd "options SC_NO_PALETTE_LOADING" |
| 48 | .Cd "options SC_NO_SYSMOUSE" |
| 49 | .Cd "options SC_PIXEL_MODE" |
| 50 | .Cd "options SC_TWOBUTTON_MOUSE" |
| 51 | .Cd "options SC_NORM_ATTR=_attribute_" |
| 52 | .Cd "options SC_NORM_REV_ATTR=_attribute_" |
| 53 | .Cd "options SC_KERNEL_CONS_ATTR=_attribute_" |
| 54 | .Cd "options SC_KERNEL_CONS_REV_ATTR=_attribute_" |
| 55 | .Cd "options SC_DFLT_FONT" |
| 56 | .Cd "makeoptions SC_DFLT_FONT=_font_name_" |
| 57 | .Cd "device sc0 at isa?" Op flags Ar flags |
| 58 | .Sh DESCRIPTION |
| 59 | The |
| 60 | .Nm |
| 61 | driver provides multiple virtual terminals. |
| 62 | It resembles the SCO color console driver. |
| 63 | .Pp |
| 64 | The |
| 65 | .Nm |
| 66 | driver is implemented on top of the keyboard driver |
| 67 | .Pq Xr atkbd 4 |
| 68 | and the video card driver |
| 69 | .Pq Xr vga 4 |
| 70 | and so requires both of them to be configured in the system. |
| 71 | .Pp |
| 72 | There can be only one |
| 73 | .Nm |
| 74 | device defined in the system. |
| 75 | .Ss Virtual Terminals |
| 76 | The |
| 77 | .Nm |
| 78 | driver provides multiple virtual terminals which appear as if they were |
| 79 | separate terminals. |
| 80 | One virtual terminal is considered current and exclusively |
| 81 | occupies the screen and the keyboard; the other virtual terminals |
| 82 | are placed in the background. |
| 83 | .Pp |
| 84 | In order to use virtual terminals, they must be individually |
| 85 | marked ``on'' in |
| 86 | .Pa /etc/ttys |
| 87 | so that |
| 88 | .Xr getty 8 |
| 89 | will recognize them to be active and run |
| 90 | .Xr login 1 |
| 91 | to let the user log in to the system. |
| 92 | By default, only the first eight virtual terminals are activated in |
| 93 | .Pa /etc/ttys . |
| 94 | .Pp |
| 95 | You press the |
| 96 | .Dv Alt |
| 97 | key and a switch key to switch between |
| 98 | virtual terminals. |
| 99 | The following table summarizes the correspondence between the switch |
| 100 | key and the virtual terminal. |
| 101 | .Bd -literal -offset indent |
| 102 | Alt-F1 ttyv0 Alt-F7 ttyv6 Shift-Alt-F1 ttyv10 |
| 103 | Alt-F2 ttyv1 Alt-F8 ttyv7 Shift-Alt-F2 ttyv11 |
| 104 | Alt-F3 ttyv2 Alt-F9 ttyv8 Shift-Alt-F3 ttyv12 |
| 105 | Alt-F4 ttyv3 Alt-F10 ttyv9 Shift-Alt-F4 ttyv13 |
| 106 | Alt-F5 ttyv4 Alt-F11 ttyv10 Shift-Alt-F5 ttyv14 |
| 107 | Alt-F6 ttyv5 Alt-F12 ttyv11 Shift-Alt-F6 ttyv15 |
| 108 | .Ed |
| 109 | .Pp |
| 110 | You can also use the ``nscr'' key (usually the |
| 111 | .Dv PrintScreen |
| 112 | key on the AT Enhanced keyboard) to cycle available virtual terminals. |
| 113 | .Pp |
| 114 | The default number of available virtual terminals is 16. |
| 115 | This can be changed with the kernel configuration option |
| 116 | .Dv MAXCONS |
| 117 | (see below). |
| 118 | .Pp |
| 119 | Note that the X server usually requires a virtual terminal for display |
| 120 | purposes, so at least one terminal must be left unused by |
| 121 | .Xr getty 8 |
| 122 | so that it can be used by the X server. |
| 123 | .Ss Key Definitions and Function Key Strings |
| 124 | The |
| 125 | .Nm |
| 126 | driver, in conjunction with the keyboard driver, allows the user |
| 127 | to change key definitions and function key strings. |
| 128 | The |
| 129 | .Xr kbdcontrol 1 |
| 130 | command will load a key definition file (known as ``keymap'' file), |
| 131 | dump the current keymap, and assign a string to a function key. |
| 132 | See |
| 133 | .Xr keyboard 4 |
| 134 | and |
| 135 | .Xr kbdmap 5 |
| 136 | for the keymap file. |
| 137 | .Pp |
| 138 | You may want to set the |
| 139 | .Ar keymap |
| 140 | variable in |
| 141 | .Pa /etc/rc.conf.local |
| 142 | to the desired keymap file so that it will be automatically loaded |
| 143 | when the system starts up. |
| 144 | .Ss Software Font |
| 145 | For most modern video cards, e.g. VGA, the |
| 146 | .Nm |
| 147 | driver and the video card driver allow the user to change |
| 148 | the font used on the screen. |
| 149 | The |
| 150 | .Xr vidcontrol 1 |
| 151 | command can be used to load a font file from |
| 152 | .Pa /usr/share/syscons/fonts . |
| 153 | .Pp |
| 154 | The font comes in various sizes: 8x8, 8x14 and 8x16. |
| 155 | The 8x16 font is typically used for the VGA card in the |
| 156 | 80-column-by-25-line mode. |
| 157 | Other video modes may require different font sizes. |
| 158 | It is better to always load all three sizes of the same font. |
| 159 | .Pp |
| 160 | You may set |
| 161 | .Ar font8x8 , |
| 162 | .Ar font8x14 |
| 163 | and |
| 164 | .Ar font8x16 |
| 165 | variables in |
| 166 | .Pa /etc/rc.conf |
| 167 | to the desired font files so that they will be automatically loaded |
| 168 | when the system starts up. |
| 169 | .Pp |
| 170 | Optionally you can specify a particular font file as the default. |
| 171 | See the |
| 172 | .Dv SC_DFLT_FONT |
| 173 | option below. |
| 174 | .Ss Screen Map |
| 175 | If your video card does not support software fonts, you may still be able |
| 176 | to achieve a similar effect by re-mapping the font built into your video card. |
| 177 | Use |
| 178 | .Xr vidcontrol 1 |
| 179 | to load a screen map file which defines the mapping between character codes. |
| 180 | .Ss Mouse Support and Copy-and-Paste |
| 181 | You can use your mouse to copy text on the screen and paste it as if |
| 182 | it was typed by hand. |
| 183 | You must be running the mouse daemon |
| 184 | .Xr moused 8 |
| 185 | and enable the mouse cursor in the virtual terminal via |
| 186 | .Xr vidcontrol 1 . |
| 187 | .Pp |
| 188 | Pressing mouse button 1 (usually the left button) will start selection. |
| 189 | Releasing button 1 will end the selection process. |
| 190 | The selected text will be marked by inverting foreground and |
| 191 | background colors. |
| 192 | You can press button 3 (usually the right button) to extend |
| 193 | the selected region. |
| 194 | The selected text is placed in the copy buffer and can be pasted |
| 195 | at the cursor position by pressing button 2 (usually the |
| 196 | middle button) as many times as you like. |
| 197 | .Pp |
| 198 | If your mouse has only two buttons, you may want to use the |
| 199 | .Dv SC_TWOBUTTON_MOUSE |
| 200 | option below to make the right button to paste the text. |
| 201 | Alternatively you can make the mouse daemon |
| 202 | emulate the middle button. |
| 203 | See the man page for |
| 204 | .Xr moused 8 |
| 205 | for more details. |
| 206 | .Ss Back Scrolling |
| 207 | The |
| 208 | .Nm |
| 209 | driver allows the user to browse the output which has ``scrolled off'' |
| 210 | the top of the screen. |
| 211 | .Pp |
| 212 | Press the ``slock'' key (usually |
| 213 | .Dv ScrllLock |
| 214 | / |
| 215 | .Dv Scroll Lock |
| 216 | or |
| 217 | .Dv Pause |
| 218 | on many keyboards) and the terminal is |
| 219 | in the ``scrollback'' mode. |
| 220 | It is indicated by the |
| 221 | .Dv Scroll Lock |
| 222 | LED. |
| 223 | Use the arrow keys, the |
| 224 | .Dv Page Up/Down |
| 225 | keys and the |
| 226 | .Dv Home/End |
| 227 | keys to scroll buffered terminal output. |
| 228 | Press the ``slock'' key again to get back to the normal terminal mode. |
| 229 | .Pp |
| 230 | The size of the scrollback buffer can be set by the |
| 231 | .Dv SC_HISTORY_SIZE |
| 232 | option described below. |
| 233 | .Ss Screen Saver |
| 234 | The |
| 235 | .Nm |
| 236 | driver can be made to put up the screen saver if the current |
| 237 | virtual terminal is idle, that is, the user is not typing |
| 238 | on the keyboard nor moving the mouse. |
| 239 | See |
| 240 | .Xr splash 4 |
| 241 | and |
| 242 | .Xr vidcontrol 1 |
| 243 | for more details. |
| 244 | .Sh DRIVER CONFIGURATION |
| 245 | .Ss Kernel Configuration Options |
| 246 | The following kernel configuration options control the |
| 247 | .Nm |
| 248 | driver. |
| 249 | .Bl -tag -width MOUSE |
| 250 | .It Dv MAXCONS=N |
| 251 | This option sets the number of virtual terminals to |
| 252 | .Fa N . |
| 253 | The default value is 16. |
| 254 | .It Dv SC_ALT_MOUSE_IMAGE |
| 255 | This option selects the alternative way of displaying the mouse cursor |
| 256 | in the virtual terminal. |
| 257 | It may be expensive for some video cards to draw the arrow-shaped |
| 258 | cursor, and you may want to try this option. |
| 259 | However, the appearance of the alternative mouse cursor may not be |
| 260 | very appealing. |
| 261 | Note that if you use the |
| 262 | .Dv SC_NO_FONT_LOADING |
| 263 | option then you must also use this option if you wish to be able to use |
| 264 | the mouse. |
| 265 | .It Dv SC_DISABLE_DDBKEY |
| 266 | This option disables the ``debug'' key combination (by default, it is |
| 267 | .Dv Alt-Esc , |
| 268 | or |
| 269 | .Dv Ctl-PrintScreen ) . |
| 270 | It will prevent users from |
| 271 | entering the kernel debugger (DDB) by pressing the key combination. |
| 272 | DDB will still be invoked when the kernel panics or hits a break point |
| 273 | if it is included in the kernel. |
| 274 | .It Dv SC_DISABLE_REBOOT |
| 275 | This option disables the ``reboot'' key (by default, it is |
| 276 | .Dv Ctl-Alt-Del ) , |
| 277 | so that the casual user may not accidentally reboot the system. |
| 278 | .It Dv SC_HISTORY_SIZE=N |
| 279 | Sets the size of back scroll buffer to |
| 280 | .Fa N |
| 281 | lines. |
| 282 | The default value is 100. |
| 283 | .It Dv SC_MOUSE_CHAR=C |
| 284 | Unless the |
| 285 | .Dv SC_ALT_MOUSE_IMAGE |
| 286 | option above is specified, the |
| 287 | .Nm |
| 288 | driver reserves four consecutive character codes in order to display the |
| 289 | mouse cursor in the virtual terminals in some systems. |
| 290 | This option specifies the first character code to |
| 291 | .Fa C |
| 292 | to be used for this purpose. |
| 293 | The default value is 0xd0. |
| 294 | A good candidate is 0x03. |
| 295 | .It Dv SC_PIXEL_MODE |
| 296 | Adds support for pixel (raster) mode console. |
| 297 | This mode is useful on some laptop computers, but less so on |
| 298 | most other systems, and it adds substantial amount of code to |
| 299 | .Nm . |
| 300 | If this option is NOT defined, you can reduce the kernel size a lot. |
| 301 | See the |
| 302 | .Dv VESA800X600 |
| 303 | flag below. |
| 304 | .It Dv SC_TWOBUTTON_MOUSE |
| 305 | If you have a two button mouse, you may want to add this option |
| 306 | to use the right button of the mouse to paste text. |
| 307 | See |
| 308 | .Sx Mouse Support and Copy-and-Paste |
| 309 | above. |
| 310 | .It Dv SC_NORM_ATTR=_attribute_ |
| 311 | .It Dv SC_NORM_REV_ATTR=_attribute_ |
| 312 | .It Dv SC_KERNEL_CONS_ATTR=_attribute_ |
| 313 | .It Dv SC_KERNEL_CONS_REV_ATTR=_attribute_ |
| 314 | These options will set the default colors. |
| 315 | Available colors are defined in |
| 316 | .In machine/pc/display.h . |
| 317 | See |
| 318 | .Sx EXAMPLES |
| 319 | below. |
| 320 | .It Dv SC_DFLT_FONT |
| 321 | This option will specify the default font. |
| 322 | Available fonts are: iso, iso2, koi8-r, koi8-u, cp437, cp850, cp865, |
| 323 | cp866 and cp866u. |
| 324 | 16-line, 14-line and 8-line font data will be compiled in. |
| 325 | Without this option, the |
| 326 | .Nm |
| 327 | driver will use whatever font is already loaded in the video card, |
| 328 | unless you explicitly load a software font at startup. |
| 329 | See |
| 330 | .Sx EXAMPLES |
| 331 | below. |
| 332 | .El |
| 333 | .Pp |
| 334 | The following options will remove some features from the |
| 335 | .Nm |
| 336 | driver and save kernel memory. |
| 337 | .Bl -tag -width MOUSE |
| 338 | .It Dv SC_NO_CUTPASTE |
| 339 | This option disables ``copy and paste'' operation in virtual |
| 340 | terminals. |
| 341 | .It Dv SC_NO_FONT_LOADING |
| 342 | The |
| 343 | .Nm |
| 344 | driver can load software fonts on some video cards. |
| 345 | This option removes this feature. |
| 346 | Note that if you still wish to use |
| 347 | the mouse with this option then you must also use the |
| 348 | .Dv SC_ALT_MOUSE_IMAGE |
| 349 | option. |
| 350 | .It Dv SC_NO_HISTORY |
| 351 | This option disables back-scrolling in virtual terminals. |
| 352 | .\".It Dv SC_NO_PALETTE_LOADING |
| 353 | .It Dv SC_NO_SYSMOUSE |
| 354 | This option removes mouse support in the |
| 355 | .Nm |
| 356 | driver. |
| 357 | The mouse daemon |
| 358 | .Xr moused 8 |
| 359 | will fail if this option is defined. |
| 360 | This option implies the |
| 361 | .Dv SC_NO_CUTPASTE |
| 362 | option too. |
| 363 | .El |
| 364 | .Ss Driver Flags |
| 365 | The following driver flags can be used to control the |
| 366 | .Nm |
| 367 | driver. |
| 368 | They can be set either in the kernel configuration file |
| 369 | (see |
| 370 | .Xr config 8 ) , |
| 371 | or else in the User Configuration Menu at boot |
| 372 | time |
| 373 | (see |
| 374 | .Xr boot 8 ) . |
| 375 | .Bl -tag -width bit_0 |
| 376 | .\".It bit 0 (VISUAL_BELL) |
| 377 | .\"Uses the ``visual'' bell. |
| 378 | .\"The screen will blink instead of generating audible sound. |
| 379 | .\".It bit 1,2 (CURSOR_TYPE) |
| 380 | .\"This option specifies the cursor appearance. |
| 381 | .\"Possible values are: |
| 382 | .\".Bl -tag -width TYPE -compact |
| 383 | .\".It Dv 0 |
| 384 | .\"normal block cursor |
| 385 | .\".It Dv 2 |
| 386 | .\"blinking block cursor |
| 387 | .\".It Dv 4 |
| 388 | .\"underline cursor |
| 389 | .\".It Dv 6 |
| 390 | .\"blinking underline (aka destructive) cursor |
| 391 | .\".El |
| 392 | .\".It bit 6 (QUIET_BELL) |
| 393 | .\"This option suppresses the bell, whether audible or visual, |
| 394 | .\"if it is rung in a background virtual terminal. |
| 395 | .It 0x0080 (VESA800X600) |
| 396 | This option puts the video card in the VESA 800x600 pixel, 16 color |
| 397 | mode. |
| 398 | It may be useful for laptop computers for which the 800x600 mode |
| 399 | is otherwise unsupported by the X server. |
| 400 | Note that in order for this flag to work, the kernel must be |
| 401 | compiled with the |
| 402 | .Dv SC_PIXEL_MODE |
| 403 | option explained above. |
| 404 | .\"Note also that the ``copy-and-paste'' function is not currently supported |
| 405 | .\"in this mode and the mouse pointer will not be displayed. |
| 406 | .It 0x0100 (AUTODETECT_KBD) |
| 407 | This option instructs the |
| 408 | .Nm |
| 409 | driver to periodically scan |
| 410 | for a keyboard device if it is not currently attached to one. |
| 411 | Otherwise, the driver only probes for a keyboard once during bootup. |
| 412 | .El |
| 413 | .Sh IOCTLS |
| 414 | The following |
| 415 | .Xr ioctl 2 |
| 416 | commands are defined for the |
| 417 | .Nm |
| 418 | driver in |
| 419 | .In sys/consio.h . |
| 420 | .Pp |
| 421 | .Bl -tag -width CONS -compact |
| 422 | .It Dv KDGETMODE Ar int *mode |
| 423 | .It Dv KDSETMODE Ar int *mode |
| 424 | Get or set the mode of the current (virtual) console. The |
| 425 | .Dv mode |
| 426 | can be one of: |
| 427 | .Pp |
| 428 | .Bl -tag -width KD_GRAPHICS -compact |
| 429 | .It Dv KD_TEXT |
| 430 | same as |
| 431 | .Dv KD_TEXT0 |
| 432 | .It Dv KD_TEXT0 |
| 433 | Text mode, restore fonts and palette |
| 434 | .It Dv KD_GRAPHICS |
| 435 | Graphics mode |
| 436 | .It Dv KD_TEXT1 |
| 437 | Text mode, don't restore fonts and palette |
| 438 | .It Dv KD_PIXEL |
| 439 | Raster (pixel) text mode |
| 440 | .El |
| 441 | .Pp |
| 442 | .It Dv KDSBORDER Ar int *color |
| 443 | Set the border color of the current (virtual) console. |
| 444 | .Pp |
| 445 | .It Dv KDRASTER Ar scr_size_t *sizes |
| 446 | Set raster (pixel) text mode and adjust the current (virtual) console's |
| 447 | geometry and font size. The |
| 448 | .Dv scr_size_t |
| 449 | argument structure is as follows: |
| 450 | .Bd -literal |
| 451 | struct _scr_size { |
| 452 | int scr_size[3]; |
| 453 | }; |
| 454 | .Ed |
| 455 | .Pp |
| 456 | .It Dv GIO_SCRNMAP Ar scrmap_t *map |
| 457 | .It Dv PIO_SCRNMAP Ar scrmap_t *map |
| 458 | Get or set the screen map for the current (virtual) console. The |
| 459 | .Dv scrmap_t |
| 460 | argument structure is defined as follows: |
| 461 | .Bd -literal |
| 462 | struct _scrmap { |
| 463 | char scrmap[256]; |
| 464 | }; |
| 465 | .Ed |
| 466 | .Pp |
| 467 | .It Dv GIO_ATTR Ar int *attr |
| 468 | Get the current text attribute. |
| 469 | .Pp |
| 470 | .It Dv GIO_COLOR Ar int *color |
| 471 | Get the current text color. |
| 472 | .Pp |
| 473 | .It Dv CONS_CURRENT Ar int *type |
| 474 | Get the adapter type. This is equivalent to |
| 475 | .Dv FBIO_ADPTYPE . |
| 476 | .Pp |
| 477 | .It Dv CONS_GET Ar int *mode |
| 478 | Get the current video mode. This is equivalent to |
| 479 | .Dv FBIO_GETMODE . |
| 480 | .Pp |
| 481 | .It Dv CONS_BLANKTIME Ar int *time |
| 482 | Set the screen saver blank interval (in seconds). |
| 483 | .Pp |
| 484 | .It Dv CONS_CURSORTYPE Ar int *type |
| 485 | Set the text cursor shape. The argument |
| 486 | .Dv type |
| 487 | can be one or more of the following: |
| 488 | .Pp |
| 489 | .Bl -tag -width CONS_BLINK_CURSOR -compact |
| 490 | .It Dv CONS_BLINK_CURSOR |
| 491 | Set for a blinking cursor, unset for a non-blinking cursor. |
| 492 | .It Dv CONS_CHAR_CURSOR |
| 493 | Set for an underscore-shaped cursor, unset for a rectangle. |
| 494 | .El |
| 495 | .Pp |
| 496 | .It Dv CONS_BELLTYPE Ar int *type |
| 497 | Set the bell type. The argument |
| 498 | .Dv type |
| 499 | is one or more of: |
| 500 | .Pp |
| 501 | .Bl -tag -width CONS_VISUAL_BELL -compact |
| 502 | .It Dv CONS_VISUAL_BELL |
| 503 | Set for a visual bell, unset for an audible bell. |
| 504 | .It Dv CONS_QUIET_BELL |
| 505 | Set to enable the bell, unset to disable it. |
| 506 | .El |
| 507 | .Pp |
| 508 | .It Dv CONS_HISTORY Ar int *size |
| 509 | Set the history (scroll back) buffer size (in lines). |
| 510 | .Pp |
| 511 | .It Dv CONS_CLRHIST |
| 512 | Clear the history (scroll back) buffer. |
| 513 | .Pp |
| 514 | .It Dv CONS_IDLE Ar int *idle |
| 515 | Check if the (virtual) console has been idle. |
| 516 | .Pp |
| 517 | .It Dv CONS_SAVERMODE Ar int *mode |
| 518 | Set the screen saver mode. The argument |
| 519 | .Dv mode |
| 520 | can be one of: |
| 521 | .Pp |
| 522 | .Bl -tag -width CONS_LKM_SAVER -compact |
| 523 | .It Dv CONS_NO_SAVER |
| 524 | Disable screen saver |
| 525 | .It Dv CONS_USR_SAVER |
| 526 | Enable screen saver |
| 527 | .It Dv CONS_LKM_SAVER |
| 528 | Add a new screen saver |
| 529 | .El |
| 530 | .Pp |
| 531 | .It Dv CONS_SAVERSTART Ar int *start |
| 532 | Start or stop the screen saver. |
| 533 | .Pp |
| 534 | .It Dv PIO_FONT8x8 Ar fnt8_t *font |
| 535 | .It Dv GIO_FONT8x8 Ar fnt8_t *font |
| 536 | Get or set the 8x8 font. The |
| 537 | .Dv fnt8_t |
| 538 | argument structure is defined as follows: |
| 539 | .Bd -literal |
| 540 | struct fnt8 { |
| 541 | char fnt8x8[8*256]; |
| 542 | }; |
| 543 | .Ed |
| 544 | .Pp |
| 545 | .It Dv PIO_FONT8x14 Ar fnt14_t *font |
| 546 | .It Dv GIO_FONT8x14 Ar fnt14_t *font |
| 547 | Get or set the 8x14 font. The |
| 548 | .Dv fnt14_t |
| 549 | argument structure is defined as follows: |
| 550 | .Bd -literal |
| 551 | struct fnt14 { |
| 552 | char fnt8x14[14*256]; |
| 553 | }; |
| 554 | .Ed |
| 555 | .Pp |
| 556 | .It Dv PIO_FONT8x16 Ar fnt16_t *font |
| 557 | .It Dv GIO_FONT8x16 Ar fnt16_t *font |
| 558 | Get or set the 8x16 font. The |
| 559 | .Dv fnt16_t |
| 560 | argument structure is defined as follows: |
| 561 | .Bd -literal |
| 562 | struct fnt16 { |
| 563 | char fnt8x16[16*256]; |
| 564 | }; |
| 565 | .Ed |
| 566 | .Pp |
| 567 | .It Dv CONS_GETINFO Ar vid_info_t *info |
| 568 | Get information about the current video mode. The |
| 569 | .Dv vid_info_t |
| 570 | structure is defined as follows: |
| 571 | .Bd -literal |
| 572 | struct vid_info { |
| 573 | short size; |
| 574 | short m_num; |
| 575 | u_short font_size; |
| 576 | u_short mv_row, mv_col; |
| 577 | u_short mv_rsz, mv_csz; |
| 578 | struct colors mv_norm, |
| 579 | mv_rev, |
| 580 | mv_grfc; |
| 581 | u_char mv_ovscan; |
| 582 | u_char mk_keylock; |
| 583 | }; |
| 584 | .Ed |
| 585 | .Pp |
| 586 | .It Dv CONS_GETVERS Ar int *version |
| 587 | Get the version of the driver. |
| 588 | .Pp |
| 589 | .It Dv CONS_CURRENTADP Ar int *adapter |
| 590 | Get the video adapter index. This is equivalent to |
| 591 | .Dv FBIO_ADAPTER . |
| 592 | .Pp |
| 593 | .It Dv CONS_ADPINFO Ar video_adapter_info_t *info |
| 594 | Get the video adapter information. This is equivalent to |
| 595 | .Dv FBIO_ADPINFO . |
| 596 | .Pp |
| 597 | .It Dv CONS_MODEINFO Ar video_info_t *info |
| 598 | Get the video mode information. This is equivalent to |
| 599 | .Dv FBIO_MODEINFO . |
| 600 | .Pp |
| 601 | .It Dv CONS_FINDMODE Ar video_info_t *info |
| 602 | Find a video mode. This is equivalent to |
| 603 | .Dv FBIO_FINDMODE . |
| 604 | .Pp |
| 605 | .It Dv CONS_SETWINORG Ar u_int *origin |
| 606 | Set the frame buffer window origin. This is equivalent to |
| 607 | .Dv FBIO_SETWINORG . |
| 608 | .Pp |
| 609 | .It Dv CONS_SETKBD Ar int *kbd |
| 610 | Set a new keyboard. |
| 611 | .Pp |
| 612 | .It Dv CONS_RELKBD |
| 613 | Release the current keyboard. |
| 614 | .Pp |
| 615 | .It Dv CONS_SCRSHOT Ar scrshot_t *data |
| 616 | Make a snapshot of the current video buffer. The |
| 617 | .Dv scrshot_t |
| 618 | structure is defined as: |
| 619 | .Bd -literal |
| 620 | struct scrshot { |
| 621 | int xsize; |
| 622 | int ysize; |
| 623 | u_int16_t* buf; |
| 624 | }; |
| 625 | .Ed |
| 626 | .Pp |
| 627 | .It Dv CONS_GETTERM Ar term_info_t *info |
| 628 | .It Dv CONS_SETTERM Ar term_info_t *info |
| 629 | Get or set terminal characteristics. The |
| 630 | .Dv term_info_t |
| 631 | structure is defined as: |
| 632 | .Bd -literal |
| 633 | struct term_info { |
| 634 | int ti_index; |
| 635 | int ti_flags; |
| 636 | u_char ti_name[TI_NAME_LEN]; |
| 637 | u_char ti_desc[TI_DESC_LEN]; |
| 638 | }; |
| 639 | .Ed |
| 640 | .Pp |
| 641 | .It Dv VT_OPENQRY Ar int *term |
| 642 | Get the next available terminal. |
| 643 | .Pp |
| 644 | .It Dv VT_SETMODE Ar vtmode_t *mode |
| 645 | .It Dv VT_GETMODE Ar vtmode_t *mode |
| 646 | Get or set the terminal switching mode. The |
| 647 | .Dv vtmode_t |
| 648 | argument structure is defined as follows: |
| 649 | .Bd -literal |
| 650 | struct vt_mode { |
| 651 | char mode; |
| 652 | char waitv; |
| 653 | short relsig; |
| 654 | short acqsig; |
| 655 | short frsig; |
| 656 | }; |
| 657 | .Ed |
| 658 | .Pp |
| 659 | .It Dv VT_RELDISP Ar int *ack |
| 660 | Acknowledge the release or acquisition of a terminal. The |
| 661 | .Dv ack |
| 662 | argument can be one of: |
| 663 | .Pp |
| 664 | .Bl -tag -width VT_ACKACQ -compact |
| 665 | .It Dv VT_FALSE |
| 666 | The user refuses to release the screen, abort |
| 667 | .It Dv VT_TRUE |
| 668 | The user has released the screen, go on |
| 669 | .It Dv VT_ACKACQ |
| 670 | Acquisition of the screen acknowledged, switch completed |
| 671 | .El |
| 672 | .Pp |
| 673 | .It Dv VT_ACTIVATE Ar int *term |
| 674 | Activate the specified terminal. |
| 675 | .Pp |
| 676 | .It Dv VT_WAITACTIVE Ar int *term |
| 677 | Wait until the specified terminal is active. |
| 678 | .Pp |
| 679 | .It Dv VT_GETACTIVE Ar int *term |
| 680 | Get the currently active terminal. |
| 681 | .Pp |
| 682 | .It Dv VT_GETINDEX Ar int *index |
| 683 | Get the index of the terminal. |
| 684 | .Pp |
| 685 | .It Dv VT_LOCKSWITCH Ar int *lock |
| 686 | Prevent or permit terminal switching. |
| 687 | .El |
| 688 | .Ss Commands for video mode switching |
| 689 | The following |
| 690 | .Xr ioctl 2 |
| 691 | commands are defined for switching video modes. See |
| 692 | .In sys/fbio.h |
| 693 | for defined mode numbers (commands for higher mode numbers have to be |
| 694 | supplied by the programmer): |
| 695 | .Dv SW_B40x25 , |
| 696 | .Dv SW_B80x25 , |
| 697 | .Dv SW_C80x25 , |
| 698 | .Dv SW_BG320 , |
| 699 | .Dv SW_CG320 , |
| 700 | .Dv SW_BG640 , |
| 701 | .Dv SW_EGAMONO80x25 , |
| 702 | .Dv SW_CG320_D , |
| 703 | .Dv SW_CG640_E , |
| 704 | .Dv SW_EGAMONOAPA , |
| 705 | .Dv SW_CG640x350 , |
| 706 | .Dv SW_ENH_MONOAPA2 , |
| 707 | .Dv SW_ENH_CG640 , |
| 708 | .Dv SW_ENH_B40x25 , |
| 709 | .Dv SW_ENH_C40x25 , |
| 710 | .Dv SW_ENH_B80x25 , |
| 711 | .Dv SW_ENH_C80x25 , |
| 712 | .Dv SW_ENH_B80x43 , |
| 713 | .Dv SW_ENH_C80x43 , |
| 714 | .Dv SW_MCAMODE , |
| 715 | .Dv SW_VGA_C40x25 , |
| 716 | .Dv SW_VGA_C80x25 , |
| 717 | .Dv SW_VGA_C80x30 , |
| 718 | .Dv SW_VGA_C80x50 , |
| 719 | .Dv SW_VGA_C80x60 , |
| 720 | .Dv SW_VGA_M80x25 , |
| 721 | .Dv SW_VGA_M80x30 , |
| 722 | .Dv SW_VGA_M80x50 , |
| 723 | .Dv SW_VGA_M80x60 , |
| 724 | .Dv SW_VGA11 , |
| 725 | .Dv SW_BG640x480 , |
| 726 | .Dv SW_VGA12 , |
| 727 | .Dv SW_CG640x480 , |
| 728 | .Dv SW_VGA13 , |
| 729 | .Dv SW_VGA_CG320 , |
| 730 | .Dv SW_VGA_CG640 , |
| 731 | .Dv SW_VGA_MODEX , |
| 732 | .Dv SW_VGA_C90x25 , |
| 733 | .Dv SW_VGA_M90x25 , |
| 734 | .Dv SW_VGA_C90x30 , |
| 735 | .Dv SW_VGA_M90x30 , |
| 736 | .Dv SW_VGA_C90x43 , |
| 737 | .Dv SW_VGA_M90x43 , |
| 738 | .Dv SW_VGA_C90x50 , |
| 739 | .Dv SW_VGA_M90x50 , |
| 740 | .Dv SW_VGA_C90x60 , |
| 741 | .Dv SW_VGA_M90x60 , |
| 742 | .Dv SW_TEXT_80x25 , |
| 743 | .Dv SW_TEXT_80x30 , |
| 744 | .Dv SW_TEXT_80x43 , |
| 745 | .Dv SW_TEXT_80x50 , |
| 746 | .Dv SW_TEXT_80x60 , |
| 747 | .Dv SW_TEXT_132x25 , |
| 748 | .Dv SW_TEXT_132x30 , |
| 749 | .Dv SW_TEXT_132x43 , |
| 750 | .Dv SW_TEXT_132x50 , |
| 751 | .Dv SW_TEXT_132x60 , |
| 752 | .Dv SW_VESA_CG640x400 , |
| 753 | .Dv SW_VESA_CG640x480 , |
| 754 | .Dv SW_VESA_800x600 , |
| 755 | .Dv SW_VESA_CG800x600 , |
| 756 | .Dv SW_VESA_1024x768 , |
| 757 | .Dv SW_VESA_CG1024x768 , |
| 758 | .Dv SW_VESA_1280x1024 , |
| 759 | .Dv SW_VESA_CG1280x1024 , |
| 760 | .Dv SW_VESA_C80x60 , |
| 761 | .Dv SW_VESA_C132x25 , |
| 762 | .Dv SW_VESA_C132x43 , |
| 763 | .Dv SW_VESA_C132x50 , |
| 764 | .Dv SW_VESA_C132x60 , |
| 765 | .Dv SW_VESA_32K_320 , |
| 766 | .Dv SW_VESA_64K_320 , |
| 767 | .Dv SW_VESA_FULL_320 , |
| 768 | .Dv SW_VESA_32K_640 , |
| 769 | .Dv SW_VESA_64K_640 , |
| 770 | .Dv SW_VESA_FULL_640 , |
| 771 | .Dv SW_VESA_32K_800 , |
| 772 | .Dv SW_VESA_64K_800 , |
| 773 | .Dv SW_VESA_FULL_800 , |
| 774 | .Dv SW_VESA_32K_1024 , |
| 775 | .Dv SW_VESA_64K_1024 , |
| 776 | .Dv SW_VESA_FULL_1024 , |
| 777 | .Dv SW_VESA_32K_1280 , |
| 778 | .Dv SW_VESA_64K_1280 , |
| 779 | .Dv SW_VESA_FULL_1280 |
| 780 | .Sh FILES |
| 781 | .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact |
| 782 | .It Pa /dev/console |
| 783 | .It Pa /dev/consolectl |
| 784 | .It Pa /dev/ttyv? |
| 785 | virtual terminals |
| 786 | .It Pa /etc/ttys |
| 787 | terminal initialization information |
| 788 | .It Pa /usr/share/syscons/fonts/* |
| 789 | font files |
| 790 | .It Pa /usr/share/syscons/keymaps/* |
| 791 | key map files |
| 792 | .It Pa /usr/share/syscons/scrmaps/* |
| 793 | screen map files |
| 794 | .El |
| 795 | .Sh EXAMPLES |
| 796 | As the |
| 797 | .Nm |
| 798 | driver requires the keyboard driver and the video card driver, |
| 799 | the kernel configuration file should contain the following lines. |
| 800 | .Bd -literal -offset indent |
| 801 | device atkbdc0 at isa? port IO_KBD |
| 802 | device atkbd0 at atkbdc? irq 1 |
| 803 | device vga0 at isa? |
| 804 | device sc0 at isa? |
| 805 | |
| 806 | pseudo-device splash |
| 807 | .Ed |
| 808 | .Pp |
| 809 | If you do not intend to load the splash image or use the screen saver, |
| 810 | the last line is not necessary, and can be omitted. |
| 811 | .Pp |
| 812 | Note that the keyboard controller driver |
| 813 | .Nm atkbdc |
| 814 | is required by the keyboard driver |
| 815 | .Nm atkbd . |
| 816 | .Pp |
| 817 | The following lines will set the default colors. |
| 818 | The normal text will be green on black background. |
| 819 | The reversed text will be yellow on green background. |
| 820 | Note that you cannot put any white space inside the quoted string, |
| 821 | because of the current implementation of |
| 822 | .Xr config 8 . |
| 823 | .Pp |
| 824 | .Dl "options SC_NORM_ATTR=(FG_GREEN|BG_BLACK) |
| 825 | .Dl "options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN) |
| 826 | .Pp |
| 827 | The following lines will set the default colors of the kernel message. |
| 828 | The kernel message will be printed bright red on black background. |
| 829 | The reversed message will be black on red background. |
| 830 | .Pp |
| 831 | .Dl "options SC_KERNEL_CONS_ATTR=(FG_LIGHTRED|BG_BLACK) |
| 832 | .Dl "options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED) |
| 833 | .Pp |
| 834 | The following example adds the font files |
| 835 | .Pa cp850-8x16.fnt , |
| 836 | .Pa cp850-8x14.font |
| 837 | and |
| 838 | .Pa cp850-8x8.font |
| 839 | to the kernel. |
| 840 | .Pp |
| 841 | .Dl "options SC_DFLT_FONT" |
| 842 | .Dl "makeoptions SC_DFLT_FONT=cp850 |
| 843 | .Dl "device sc0 at isa? |
| 844 | .\".Sh DIAGNOSTICS |
| 845 | .Sh CAVEATS |
| 846 | The amount of data that is possible to insert from the cut buffer is limited |
| 847 | by the |
| 848 | .Brq Dv MAX_INPUT , |
| 849 | a system limit on the number of bytes that may be stored in the terminal |
| 850 | input queue - usually 1024 bytes |
| 851 | (see |
| 852 | .Xr termios 4 ) . |
| 853 | .Sh SEE ALSO |
| 854 | .Xr kbdcontrol 1 , |
| 855 | .Xr login 1 , |
| 856 | .Xr vidcontrol 1 , |
| 857 | .Xr atkbd 4 , |
| 858 | .Xr atkbdc 4 , |
| 859 | .Xr keyboard 4 , |
| 860 | .Xr screen 4 , |
| 861 | .Xr splash 4 , |
| 862 | .Xr sysmouse 4 , |
| 863 | .Xr ukbd 4 , |
| 864 | .Xr vga 4 , |
| 865 | .Xr kbdmap 5 , |
| 866 | .Xr rc.conf 5 , |
| 867 | .Xr ttys 5 , |
| 868 | .Xr config 8 , |
| 869 | .Xr getty 8 , |
| 870 | .Xr kldload 8 , |
| 871 | .Xr moused 8 |
| 872 | .Sh HISTORY |
| 873 | The |
| 874 | .Nm |
| 875 | driver first appeared in |
| 876 | .Fx 1.0 . |
| 877 | .Sh AUTHORS |
| 878 | .An -nosplit |
| 879 | The |
| 880 | .Nm |
| 881 | driver was written by |
| 882 | .An S\(/oren Schmidt Aq sos@FreeBSD.org . |
| 883 | This manual page was written by |
| 884 | .An Kazutaka Yokota Aq yokota@FreeBSD.org |
| 885 | and |
| 886 | .An Sascha Wildner . |
| 887 | .Sh BUGS |
| 888 | This manual page is incomplete and needs revision. |