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