History log of /freebsd-10.1-release/usr.sbin/vidcontrol/vidcontrol.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 268366 07-Jul-2014 ray

267622 Log:
Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
267623 Log:
Remove stale link to deleted vt(4) xboxfb driver.
267624 Log:
syscons(4) and vt(4) can be built together now.
267625 Log:
Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
267626 Log:
Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
267965 by emaste@ Log:
Use a common tunable to choose between vt(4)/sc(4)
With this change and previous work from ray@ it will be possible to put
both in GENERIC, and have one enabled by default, but allow the other to
be selected via the loader.
(The previous implementation had separate kern.vt.disable and
hw.syscons.disable tunables, and would panic if both drivers were
compiled in and neither was explicitly disabled.)
268175 by emaste@ Log:
Fix vt(4) detection in kbdcontrol and vidcontrol
As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.
Reported by: Trond Endrestøl
268045 by emaste@ Log:
Add vt(4) to GENERIC and retire the separate VT config
vt(4) and sc(4) can now coexist in the same kernel. To choose the vt
driver, set the loader tunable kern.vty=vt .

Sponsored by: The FreeBSD Foundation


# 267540 16-Jun-2014 ray

MFC: 266836, 266839
vt(4) support for vidcontrol(1).
o Teach vidcontrol(1) how to load vt(4) font.
o Teach vidcontrol(1) to distinct which virtual terminal system is running now.
o Load vt(4) fonts from different location.
o Add $FreeBSD$ tag for path.h.
vt(4) support for kbdcontrol(1).
Enable kbdcontrol(1) to use maps from vt(4) keymaps dir /usr/share/vt/keymaps
if vt(4) is present.

Sponsored by: The FreeBSD Foundation


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 250509 11-May-2013 eadler

The M_VESA_MODE_MAX is latest valid mode - not the first invalid.
Permit its use in vidcontrol -i

PR: bin/119483
Submitted by: Dan Lukes <dan@obluda.cz>
Arrival-Date: Wed Jan 09 10:30:01 UTC 2008
Reviewed by: ed
MFC after: 3 days


# 241737 19-Oct-2012 ed

More -Wmissing-variable-declarations fixes.

In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.


# 237777 29-Jun-2012 ache

Call set_terminal_mode() after video mode change, not before, because
video mode change always reset terminal mode to xterm.
It allows things like 'vidcontrol -T cons25 80x30' works as supposed,
and allows 'allscreens_flags="-T cons25 80x30"' in /etc/rc.conf too.

MFC after: 1 week


# 228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


# 228976 29-Dec-2011 uqs

Reencode files to UTF-8. Drop CP1252 em-dash.


# 228425 11-Dec-2011 ed

Add static keywords to vidcontrol(1).

While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.


# 205855 29-Mar-2010 jkim

Print memory model of the video mode except for planar memory model.
'P', 'D', 'C', 'H', 'V' mean packed pixel, direct color, CGA, Hercules,
VGA X memory models respectively where they have fixed number of planes.


# 199174 11-Nov-2009 ed

Add a new flag to vidcontrol, -T, that allows terminal mode switching.

This will make it more easy for people to experiment with TERM=xterm.
Instead of echoing these strange escape sequences, I can just instruct
them to run `vidcontrol -T xterm'.


# 162671 26-Sep-2006 ru

Remove bogus casts of valid integer ioctl() arguments.


# 150246 17-Sep-2005 rodrigc

Fix so that color changes are not lost when the video mode changes.

PR: bin/83553
Submitted by: Dan Lukes <dan at obluda dot cz>


# 146736 29-May-2005 delphij

Add VESA mode support for syscons, which enables the support of 15, 16,
24, and 32 bit modes. To use that, syscons(4) must be built with
the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a.
vesa.ko) must be either loaded, or be compiled into the kernel.

Do not return EINVAL when the mouse state is changed to what it already is,
which seems to cause problems when you have two mice attached, and
applications are not likely obtain useful information through the EINVAL
caused by showing the mouse pointer twice.

Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is
the video mode number from the vidcontrol -i mode output. Also, revert the
video mode if something fails.

Obtained from: DragonFlyBSD
Discussed at: current@ with patch attached [1]
PR: kern/71142 [2]
Submitted by: Xuefeng DENG <dsnofe at msn com> [1],
Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2]


# 146241 15-May-2005 nyan

Use \033 instead of \e because \e is not a standard.

Noticed by: stefanf
Reviewed by: diff(1)


# 146237 15-May-2005 nyan

A foreground color number on pc98 console is 7 not 15.


# 146236 15-May-2005 nyan

Use \e for escape char instead of ^[ directly.


# 140159 13-Jan-2005 delphij

WANRS=6 cleanup for vidcontrol(1):
- Use foo(void) instead of foo().
- Use static where applicable.
- Apply more const's when passing parameters
- signed/unsigned madness
- Avoid namespace collision by adding underscores.
- For 64-bit architectures, use %zx instead of %x
when necessary.
- When storing constants, use const instead of
variable.
- Bump WARNS?= from 2 to 6


# 120201 18-Sep-2003 eivind

Propagate ioctl() failure to exit status


# 102111 19-Aug-2002 sobomax

Add a new `-H' modifier, which when combined with `-p' or `-P' allows to dump
full console history.


# 99707 10-Jul-2002 dd

Remove some missing words.

Submitted by: roam


# 99706 10-Jul-2002 dd

Deuglify the usage message by making it look more like the synopsis in
the manual page.


# 99705 10-Jul-2002 dd

Add an -S option that allows the user to disable vty switching. It is
implemented using a new VT_LOCKSWITCH ioctl. Although it is possible
to implement something like this by VT_SETMODEing to VT_PROCESS and
never releasing the vty, that method has a number of downsides, the
biggest of which is that some program has to stay resident for the
lock to be in effect.

Reviewed by: roam, sheldonh


# 97748 02-Jun-2002 schweikh

Fix typo in the BSD copyright: s/withough/without/

Spotted and suggested by: des
MFC after: 3 weeks


# 92460 16-Mar-2002 sobomax

When loading a font allow suffix specifying its size be omited, in which
case use size of the currently displaying font as a suffix. For example,
when the when the size of the currently displayed font is 8x8 the
following command will load koi8-r-8x8.fnt.

# vidcontrol -f koi8-r

MFC after: 2 weeks


# 80148 22-Jul-2001 yokota

Use the correct ioctl command to set a VESA mode.

PR: 24423
MFC after: 10 days


# 77329 28-May-2001 des

Move the scrollback controls from kbdcontrol to vidcontrol.
Also fix some style bugs in the code and poor language in the man pages.

Reviewed by: sobomax


# 76897 20-May-2001 sobomax

- Sort usage() output;
- sync usage() with reality and manpage;
- display usage() even if terminal is not a syscons.

Submitted by: ru, sobomax


# 76845 19-May-2001 sobomax

Move scrshot(1) functionality into vidcontrol(1).

Suggested by: many
Not objected to by: nik (scrshot co-author)


# 75788 21-Apr-2001 ache

Proper upper limit for mousechar start is UCHAR_MAX - 3, not UCHAR_MAX

PR: 24437
Submitted by: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>


# 75344 09-Apr-2001 sobomax

Allow user to omit font size specification when loading a font. In addition
the following fixes had been made:

- check the size of the font being loaded and compare it with possible sizes
to minimise possibility of loading something that is not a fontfile at all
and turning console screen into garbage;

- prevent buffer overflow (and coredump as a result ) when loading valid
uuencoded file with size that exceeds allocated buffer;

- correct and improve several error messages.

Approved by: -audit, -hackers (silently)


# 71642 25-Jan-2001 sobomax

New option `-g' to allow selecting custom text geometry in VESA_800x600 raster
text mode. For example `vidcontrol -g 100x37 VESA_800x600' will setup 100x37
text mode as opposed to default 80x25.

Reviewed by: imp


# 66834 08-Oct-2000 phk

Initiate deorbit burn sequence for <machine/console.h>.

Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>.
This is also the appropriate fix for exo-tree sources.

Put warnings in <machine/console.h> to discourage use.
November 15th 2000 the warnings will be converted to errors.
January 15th 2001 the <machine/console.h> files will be removed.


# 55849 12-Jan-2000 yokota

Make the mouse cursor char code configurable via the CONS_MOUSECTL
ioctl.

By popular demand.


# 52262 15-Oct-1999 billf

-Wall fix: ambigious else


# 51393 19-Sep-1999 yokota

Fix -s option.

PR: bin/13799


# 50479 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48105 22-Jun-1999 yokota

Reflect recent changes in syscons.


# 43186 25-Jan-1999 dfr

Back out a couple of i386 conditionals which aren't needed with the new
syscons and fix a few printfs.

Reviewed by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>


# 42605 12-Jan-1999 mjacob

fix for compiling on alpha


# 42505 11-Jan-1999 yokota

The first stage of console driver reorganization: activate new
keyboard and video card drivers.


# 39859 01-Oct-1998 yokota

- Express various sizes in bytes, rather than Kbytes, in the video
mode and adapter information structures.


# 39611 23-Sep-1998 gpalmer

Don't assume that we have extended modes on all platforms.


# 39592 23-Sep-1998 yokota

VESA BIOS support update in syscons.

- Accept generic video mode names: 80x25, 80x30, etc. Specific video
mode names, VGA_80x25, VESA_132x25, are still accpeted too.
- Update the man page accordingly.


# 39361 16-Sep-1998 abial

Add new '-i' option to usage().


# 39287 15-Sep-1998 sos

Add VESA support to syscons.

Kazu writes:

The VESA support code requires vm86 support. Make sure your kernel
configuration file has the following line.
options "VM86"
If you want to statically link the VESA support code to the kernel,
add the following option to the kernel configuration file.
options "VESA"

The vidcontrol command now accepts the following video mode names:
VESA_132x25, VESA_132x43, VESA_132x50, VESA_132x60, VESA_800x600

The VESA_800x600 mode is a raster display mode. The 80x25 text will
be displayed on the 800x600 screen. Useful for some laptop computers.

vidcontrol accepts the new `-i <info>' option, where <info> must be
either `adapter' or `mode'. When the `-i adapter' option is given,
vidcontrol will print basic information (not much) on the video
adapter. When the `-i mode' option is specified, vidcontrol will
list video modes which are actually supported by the video adapter.

Submitted by: Kazutaka YOKOTA yokota@FreeBSD.ORG


# 37636 14-Jul-1998 bde

ioctl() request args are unsigned longs, so don't attempt to store
them as ints. Among other bugs, doing so at best caused benign
overflow followed by fatal sign extension on machines with 32-bit
ints and 64-bit longs.


# 30764 27-Oct-1997 charnier

Use err(3). Stylistic changes in man page.


# 23702 11-Mar-1997 peter

Update to compile under Lite2 includes


# 23457 06-Mar-1997 brian

Add a -s option for setting the current vty. This should make
life easier if a PS/2 mouse locks up the keyboard (frequent-ish,
but not repeatable).
Tidy up code (a bit) and make it -Wall

Is this a 2.2 candidate ? (although it doesn't -Wall in 2.2 because
of the lack of sys/sysproto.h


# 22997 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 16947 03-Jul-1996 gpalmer

Fix typo.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


# 16565 21-Jun-1996 sos

Added new -m option, that enable / disables the mousepointer on
a textmode screen.


# 8857 30-May-1995 rgrimes

Remove trailing whitespace.


# 6862 03-Mar-1995 dima

remove option "-s saver" from usage()


# 6628 22-Feb-1995 sos

Next syscons update (given up on numbering :)

Removed screensavers from syscons, they are now LKM's. This makes it
possible to do some really "interesting" screensavers...
Fixed bug that sometimes caused garbage to appear when leaving
"scroll-lock" history.
Reformattet indentation, it got too deep for a normal 80 pos screen.
Split up in syscons.c & syscons.h for use with the saver-lkm's.
Temporarily removed -s option from vidcontrol, savers should now
be loaded with modload.


# 6239 07-Feb-1995 dima

Fixed usage() (cosmetic changes. "(string)" looks much better
than "(string" :-)


# 6230 07-Feb-1995 sos

Added new choises of cursors.


# 6047 30-Jan-1995 sos

Added 80x30 & 80x60 experimental modes officially.


# 5994 28-Jan-1995 sos

Third round in syscons update.

Display update method changed, now allways write in memory buffer,
then periodically update physical display.
Speed improvements (now > 5 times faster than the old syscons).
History now circular buffer, with changeable size.
History scroll by up/down line, up/down page, home and end.
Backtab proberly implemented.
Now space for 96 function keys, 63 allocated standard, default now
SCO/SYSV compat again as in the old days.
New keyboard definition files ~share/syscons/keymaps/*
Misc fixes for old "hacks" that broke SCO/SYSV compat.
More that I forgot before writing this...


# 5536 12-Jan-1995 sos

First round in syscons update. Several new features has been added:

No kernel config options anymore besides keyboard language layout.
Virtual consoles are now dynamically allocated, no NCONS anymore.
Software cursor blinking/nonblinking.
Visual bell for laptops (don't beep at meetings :-).
Cursor/bell default type setable via config "flags" instead of as defines.
Cursor/bell type setable via ioctl's.
New video modes 80x30 80x60 for some laptops, and those with multisync monitors.
Scroll-lock history (length currently fixed at 100 lines).
Lots of cleanups, some only commented out for now (will goaway soon).
Support for new features in vidcontrol/kbdcontrol.
Updated manpages.


# 3122 26-Sep-1994 ache

usage help: uncomment -d option, add -x option


# 2784 15-Sep-1994 sos

Added support for some of the new video modes in syscons.

Reviewed by:
Submitted by:
Obtained from:


# 2089 17-Aug-1994 sos

Added vidcontrol util from 1.1.5.1+

Reviewed by:
Submitted by: