Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / vidcontrol / vidcontrol.1
1 .\"
2 .\" vidcontrol - a utility for manipulating the syscons video driver
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\"     @(#)vidcontrol.1
14 .\" $FreeBSD: src/usr.sbin/vidcontrol/vidcontrol.1,v 1.24.2.14 2002/09/15 22:31:50 dd Exp $
15 .\"
16 .Dd May 27, 2002
17 .Dt VIDCONTROL 1
18 .Os
19 .Sh NAME
20 .Nm vidcontrol
21 .Nd system console control and configuration utility
22 .Sh SYNOPSIS
23 .Nm
24 .Op Fl CdLPpx
25 .Op Fl b Ar color
26 .Op Fl c Ar appearance
27 .Oo
28 .Fl f
29 .Op Ar size
30 .Ar file
31 .Oc
32 .Op Fl g Ar geometry
33 .Op Fl h Ar size
34 .Op Fl i Cm adapter | mode
35 .Op Fl l Ar screen_map
36 .Op Fl M Ar char
37 .Op Fl m Cm on | off
38 .Op Fl r Ar foreground Ar background
39 .Op Fl S Cm on | off
40 .Op Fl s Ar number
41 .Op Fl t Ar N | Cm off
42 .Op Ar mode
43 .Op Ar foreground Op Ar background
44 .Op Cm show
45 .Sh DESCRIPTION
46 The
47 .Nm
48 command is used to set various options for the
49 .Xr syscons 4
50 console driver,
51 such as video mode, colors, cursor shape, screen output map, font and screen
52 saver timeout.
53 .Pp
54 The following command line options are supported:
55 .Bl -tag -width indent
56 .It Ar mode
57 Select a new video mode.
58 The modes currently recognized are:
59 .Ar 80x25 ,
60 .Ar 80x30 ,
61 .Ar 80x43 ,
62 .Ar 80x50 ,
63 .Ar 80x60 ,
64 .Ar 132x25 ,
65 .Ar 132x30 ,
66 .Ar 132x43 ,
67 .Ar 132x50 ,
68 .Ar 132x60 ,
69 .Ar VGA_40x25 ,
70 .Ar VGA_80x25 ,
71 .Ar VGA_80x30 ,
72 .Ar VGA_80x50 ,
73 .Ar VGA_80x60 ,
74 .Ar VGA_90x25 ,
75 .Ar VGA_90x30 ,
76 .Ar VGA_90x43 ,
77 .Ar VGA_90x50 ,
78 .Ar VGA_90x60 ,
79 .Ar EGA_80x25 ,
80 .Ar EGA_80x43 ,
81 .Ar VESA_132x25 ,
82 .Ar VESA_132x43 ,
83 .Ar VESA_132x50 ,
84 .Ar VESA_132x60 .
85 .\"The graphic mode
86 .\".Ar VGA_320x200
87 .\"and
88 The raster text mode
89 .Ar VESA_800x600
90 can also be chosen.
91 See
92 .Sx Video Mode Support
93 below.
94 .It Ar foreground Op Ar background
95 Change colors when displaying text.
96 Specify the foreground color
97 (e.g.\&
98 .Dq vidcontrol white ) ,
99 or both a foreground and background colors
100 (e.g.\&
101 .Dq vidcontrol yellow blue ) .
102 Use the
103 .Cm show
104 command below to see available colors.
105 .It Cm show
106 See the supported colors on a given platform.
107 .It Fl b Ar color
108 Set border color to
109 .Ar color .
110 This option may not be always supported by the video driver.
111 .It Fl C
112 Clear the history buffer.
113 .It Fl c Cm normal | blink | destructive
114 Change the cursor appearance.
115 The cursor is either an inverting block
116 .Pq Cm normal
117 that can optionally
118 .Cm blink ,
119 or it can be like the old hardware cursor
120 .Pq Cm destructive .
121 The latter is actually a simulation.
122 .It Fl d
123 Print out current output screen map.
124 .It Xo
125 .Fl f
126 .Op Ar size
127 .Ar file
128 .Xc
129 Load font
130 .Ar file
131 for
132 .Ar size
133 (currently, only
134 .Cm 8x8 ,
135 .Cm 8x14
136 or
137 .Cm 8x16 ) .
138 The font file can be either uuencoded or in raw binary format.
139 You can also use the menu-driven
140 .Xr vidfont 1
141 command to load the font of your choice.
142 .Pp
143 .Ar Size
144 may be omitted, in this case
145 .Nm
146 will try to guess it from the size of font file.
147 .Pp
148 Note that older video cards, such as MDA and CGA, do not support
149 software font.
150 See also
151 .Sx Video Mode Support
152 and
153 .Sx EXAMPLES
154 below and the man page for
155 .Xr syscons 4 .
156 .It Fl g Ar geometry
157 Set the
158 .Ar geometry
159 of the text mode for the modes with selectable
160 geometry.
161 Currently only raster modes, such as
162 .Ar VESA_800x600 ,
163 support this option.
164 See also
165 .Sx Video Mode Support
166 and
167 .Sx EXAMPLES
168 below.
169 .It Fl h Ar size
170 Set the size of the history (scrollback) buffer to
171 .Ar size
172 lines.
173 .It Fl i Cm adapter
174 Shows info about the current video adapter.
175 .It Fl i Cm mode
176 Shows the possible video modes with the current video hardware.
177 .It Fl l Ar screen_map
178 Install screen output map file from
179 .Ar screen_map .
180 See also
181 .Xr syscons 4 .
182 .It Fl L
183 Install default screen output map.
184 .It Fl M Ar char
185 Sets the base character used to render the mouse pointer to
186 .Ar char .
187 .It Fl m Cm on | off
188 Switch the mouse pointer
189 .Cm on
190 or
191 .Cm off .
192 Used together with the
193 .Xr moused 8
194 daemon for text mode cut & paste functionality.
195 .It Fl p
196 Capture the current contents of the video buffer corresponding
197 to the terminal device referred to by standard input.
198 The
199 .Nm
200 utility writes contents of the video buffer to the standard
201 output in a raw binary format.
202 For details about that
203 format see
204 .Sx Format of Video Buffer Dump
205 below.
206 .It Fl P
207 Same as
208 .Fl p ,
209 but dump contents of the video buffer in a plain text format
210 ignoring nonprintable characters and information about text
211 attributes.
212 .It Fl r Ar foreground background
213 Change reverse mode colors to
214 .Ar foreground
215 and
216 .Ar background .
217 .It Fl S Cm on | off
218 Turn vty switching on or off.
219 When vty switching is off,
220 attempts to switch to a different virtual terminal will fail.
221 (The default is to permit vty switching.)
222 .It Fl s Ar number
223 Set the current vty to
224 .Ar number .
225 .It Fl t Ar N | Cm off
226 Set the screensaver timeout to
227 .Ar N
228 seconds, or turns it
229 .Cm off .
230 .It Fl x
231 Use hexadecimal digits for output.
232 .El
233 .Ss Video Mode Support
234 Note that not all modes listed above may be supported by the video
235 hardware.
236 You can verify which mode is supported by the video hardware, using the
237 .Fl i Cm mode
238 option.
239 .Pp
240 The VESA BIOS support must be linked to the kernel
241 or loaded as a KLD module if you wish to use VESA video modes
242 or 132 column modes
243 (see
244 .Xr vga 4 ) .
245 .Pp
246 You need to compile your kernel with the
247 .Ar VGA_WIDTH90
248 option if you wish to use VGA 90 column modes
249 (see
250 .Xr vga 4 ) .
251 .Pp
252 Video modes other than 25 and 30 line modes may require specific size of font.
253 Use
254 .Fl f
255 option above to load a font file to the kernel.
256 If the required size of font has not been loaded to the kernel,
257 .Nm
258 will fail if the user attempts to set a new video mode.
259 .Pp
260 .Bl -column "25 line modes" "8x16 (VGA), 8x14 (EGA)" -compact
261 .Sy Modes Ta Sy Font size
262 .Li 25 line modes Ta 8x16 (VGA), 8x14 (EGA)
263 .Li 30 line modes Ta 8x16
264 .Li 43 line modes Ta 8x8
265 .Li 50 line modes Ta 8x8
266 .Li 60 line modes Ta 8x8
267 .El
268 .Pp
269 It is better to always load all three sizes (8x8, 8x14 and 8x16)
270 of the same font.
271 .Pp
272 You may set variables in
273 .Pa /etc/rc.conf
274 or
275 .Pa /etc/rc.conf.local
276 so that desired font files will be automatically loaded
277 when the system starts up.
278 See below.
279 .Pp
280 If you want to use the raster text mode
281 .Ar VESA_800x600 ,
282 you need to recompile your kernel with the
283 .Dv SC_PIXEL_MODE
284 option.
285 See
286 .Xr syscons 4
287 for more details on this kernel option.
288 .Ss Format of Video Buffer Dump
289 The
290 .Nm
291 utility uses the
292 .Xr syscons 4
293 .Dv CONS_SCRSHOT
294 .Xr ioctl 2
295 to capture the current contents of the video buffer.
296 The
297 .Nm
298 utility writes version and additional information to the standard
299 output, followed by the contents of the terminal device.
300 .Pp
301 PC video memory is typically arranged in two byte tuples,
302 one per character position.
303 In each tuple, the first byte
304 will be the character code, and the second byte is the
305 character's color attribute.
306 .Pp
307 The color attribute byte is further broken down in to the
308 low nibble, which specifies which of 16 different foreground
309 colors is active, and the high nibble, which specifies which
310 of 16 different background colors is active.
311 .Pp
312 .Bl -hang -offset indent -compact
313 .It 0
314 Black
315 .It 1
316 Blue
317 .It 2
318 Green
319 .It 3
320 Cyan
321 .It 4
322 Red
323 .It 5
324 Magenta
325 .It 6
326 Brown
327 .It 7
328 White
329 .It 8
330 Grey
331 .It 9
332 Light Blue
333 .It 10
334 Light Green
335 .It 11
336 Light Cyan
337 .It 12
338 Light Red
339 .It 13
340 Light Magenta
341 .It 14
342 Yellow
343 .It 15
344 White
345 .El
346 .Pp
347 It can be seen that the last 8 colors are brighter
348 versions of the first 8.
349 .Pp
350 For example, the two bytes
351 .Pp
352 .Dl "65 158"
353 .Pp
354 specify an uppercase A (character code 65), in
355 yellow (low nibble 15) on a light blue background
356 (high nibble 9).
357 .Pp
358 The
359 .Nm
360 output contains a small header which includes additional
361 information which may be useful to utilities processing
362 the output.
363 .Pp
364 The first 10 bytes are always arranged as follows:
365 .Bl -column "Byte range" "Contents" -offset indent
366 .It Sy "Byte Range      Contents"
367 .It "1 thru 8   Literal text" Dq Li SCRSHOT_
368 .It "9  File format version number"
369 .It "10 Remaining number of bytes in the header"
370 .El
371 .Pp
372 Subsequent bytes depend on the version number.
373 .Bl -column "Version" "13 and up" -offset indent
374 .It Sy "Version Byte    Meaning"
375 .It "1  11      Terminal width, in characters"
376 .It "   12      Terminal depth, in characters"
377 .It "   13 and up       The snapshot data"
378 .El
379 .Pp
380 So a dump of an 80x25 screen would start (in hex)
381 .Bd -literal -offset indent
382 53 43 52 53 48 4f 54 5f 01 02 50 19
383 ----------------------- -- -- -- --
384           |              |  |  |  ` 25 decimal
385           |              |  |  `--- 80 decimal
386           |              |  `------ 2 remaining bytes of header data
387           |              `--------- File format version 1
388           `------------------------ Literal "SCRSHOT_"
389 .Ed
390 .Sh VIDEO OUTPUT CONFIGURATION
391 .Ss Boot Time Configuration
392 You may set the following variables in
393 .Pa /etc/rc.conf
394 or
395 .Pa /etc/rc.conf.local
396 in order to configure the video output at boot time.
397 .Pp
398 .Bl -tag -width foo_bar_var -compact
399 .It Ar blanktime
400 Sets the timeout value for the
401 .Fl t
402 option.
403 .It Ar font8x16 , font8x14 , font8x8
404 Specifies font files for the
405 .Fl f
406 option.
407 .It Ar scrnmap
408 Specifies a screen output map file for the
409 .Fl l
410 option.
411 .El
412 .Pp
413 See
414 .Xr rc.conf 5
415 for more details.
416 .Ss Driver Configuration
417 The video card driver may let you change default configuration
418 options, such as the default font, so that you do not need to set up
419 the options at boot time.
420 See video card driver manuals, (e.g.\&
421 .Xr vga 4 )
422 for details.
423 .Sh FILES
424 .Bl -tag -width /usr/share/syscons/scrnmaps/foo-bar -compact
425 .It Pa /usr/share/syscons/fonts/*
426 font files.
427 .It Pa /usr/share/syscons/scrnmaps/*
428 screen output map files.
429 .El
430 .Sh EXAMPLES
431 If you want to load
432 .Pa /usr/share/syscons/fonts/iso-8x16.fnt
433 to the kernel, run
434 .Nm
435 as:
436 .Pp
437 .Dl vidcontrol -f 8x16 /usr/share/syscons/fonts/iso-8x16.fnt
438 .Pp
439 So long as the font file is in
440 .Pa /usr/share/syscons/fonts ,
441 you may abbreviate the file name as
442 .Pa iso-8x16 :
443 .Pp
444 .Dl vidcontrol -f 8x16 iso-8x16
445 .Pp
446 Furthermore, you can also omit font size
447 .Dq Li 8x16 :
448 .Pp
449 .Dl vidcontrol -f iso-8x16
450 .Pp
451 Moreover, the suffix specifying the font size can be also omitted; in
452 this case,
453 .Nm
454 will use the size of the currently displayed font to construct the
455 suffix:
456 .Pp
457 .Dl vidcontrol -f iso
458 .Pp
459 Likewise, you can also abbreviate the screen output map file name for
460 the
461 .Fl l
462 option if the file is found in
463 .Pa /usr/share/syscons/scrnmaps .
464 .Pp
465 .Dl vidcontrol -l iso-8859-1_to_cp437
466 .Pp
467 The above command will load
468 .Pa /usr/share/syscons/scrnmaps/iso-8859-1_to_cp437.scm .
469 .Pp
470 The following command will set-up a 100x37 raster text mode (useful for
471 some LCD models):
472 .Pp
473 .Dl vidcontrol -g 100x37 VESA_800x600
474 .Pp
475 The following command will capture the contents of the first virtual
476 terminal, and redirect the output to the
477 .Pa shot.scr
478 file:
479 .Pp
480 .Dl vidcontrol -p < /dev/ttyv0 > shot.scr
481 .Pp
482 The following command will dump contents of the fourth virtual terminal
483 to the standard output in the human readable format:
484 .Pp
485 .Dl vidcontrol -P < /dev/ttyv3
486 .Sh SEE ALSO
487 .Xr kbdcontrol 1 ,
488 .Xr vidfont 1 ,
489 .Xr keyboard 4 ,
490 .Xr screen 4 ,
491 .Xr syscons 4 ,
492 .Xr vga 4 ,
493 .Xr rc.conf 5 ,
494 .Xr kldload 8 ,
495 .Xr moused 8 ,
496 .Xr watch 8
497 .Pp
498 The various
499 .Li scr2*
500 utilities in the
501 .Li graphics
502 and
503 .Li textproc
504 categories of the
505 .Em "Ports Collection" .
506 .Sh AUTHORS
507 .An S\(/oren Schmidt Aq sos@FreeBSD.org