/etc/TextConfig
The (default) configuration file for SVGATextMode
Textmode manipulation/enhancement tool
Part of SVGATextMode(8).
SVGATextMode [-ndhrfcvsam]
[-t
ConfigFile]
[TextmodeLabel]
SVGATextMode provides a means to seriously enhance the looks of your Linux text consoles, by re-programming the (S)VGA hardware. It uses a configuration file similar to the one the XFree86 X-windows server uses (Xconfig or XF86Config) to set up better looking text modes. (=higher resolution, larger font size, higher display refresh...).
It works independently of what text modes are allowed from the BIOS. In theory, any text mode size is possible, as long as your VGA card is up to the job. Whether it is or not, depends greatly on the chipset.
SVGATextMode can resize the console screen on the fly, without rebooting, to any other size. The configuration file holds all the parameters needed for the new mode.
It needs kernel version 1.1.54 or newer if screen resizing is to be possible.
Generic VGA chips. This can also be used for unsupported VGA chips, but with very limited possibilities. Most portable VGA computers (Compaq LTE, ...) should work with this also: VGA LCD's can't use higher dot-clocks anyway.
It is important to start from a standard VGA text mode (80x25...80x50) when using this "chipset" for unsupported chips. Otherwise the clock will not be programmed correctly.
ET6000ET4000ET3000S3any S3-based card, including those from Diamond, Number 9 and SPEA/Video7.
Cirrus Logic chipsets. This works with CL-GD542x, CL-GD543x ("Alpine") and CL-GD546x ("Laguna") chipsets.
The oldest Trident cards. NOT for the Trident accelerated cards like the 9440 etc.
All accelerated Trident cards from TGUI9320LCD and up.
All (?) Western Digital cards, from the plain old first Paradise card (PVGA1) to the more recent WDC90C33 accelerator (WDC90C3X).
All ATI cards BEFORE the MACH32.
ATIMACH32ATI MACH32 and MACH64. Many MACH64 cards use special RAMDACs and clock chips that are not yet supported by SVGATextMode. Those will not work.
ATIMACH64Only MACH64 boards with internal clock chips are supported.
VIDEO7Headland Technologies based Video 7 boards only. Older V7 boards use C&T or Cirrus chips. Newer V7/SPEA cards use S3.
Avance Logic chipsets. It's not sure whether this will work on ALL Avance Logic cards.
Oak Technology chipsets.
SiS chipsets. UNTESTED!
RealTekRealTek chipsets. UNTESTED!
ARK1000 and ARK2000 chipsets. UNTESTED!
NCR chipsets. The NCR77C21 and NCR77C22 (without "E" suffix) will not benefit from this. They should work just as well with the generic VGA driver. UNTESTED!
Genoa 6000 series cards. The 5000 and 7000 series are based on resp. ET3000 and ET4000 chips. Use the ET4000 driver for those. UNTESTED!
MX graphics chips. MX86000 and MX86010 chips should work. UNTESTED!
Matrox Millennium and Mystique are supported.
Those NeoMagic laptop controllers
RIVA128all RIVA128 derivatives (including RIVA128ZX and TNT).
SVGATextMode needs a configuration file with a similar syntax as Xconfig or XF86Config, the configuration file for XFree86, the X-Windows server. The default config file is /etc/TextConfig.
See the TextConfig(5) manual file for details on its syntax.
When running SVGATextMode with a new textmode, it will output a single line, describing what the new mode is, and what are the screen refresh rates.
Chipset = 'S3', Textmode clock = 75.00 MHz, 116x48 chars, CharCell = 9x16. Refresh = 55.93kHz/69.9Hz.
The only required option is the TextmodeLabel, which tells SVGATextMode to which mode it must switch. A mode description line with the same name must be present in the config file. The parameters on that line will be used to program the new text mode.
-n
don't program the new mode. This option will scan the config file for the requested mode, parse all parameters, and report what the new mode will look like. But it doesn't actually change anything. This is useful for seeing if a mode is correctly entered in the config file, and if your monitor will be able to handle it.
-d
debugging mode. SVGATextMode will output lots of debugging information about all the things it attempts to do. This is mostly for "internal purposes" only, but it could help you discover why SVGATextMode doesn't react as you expect it to. This could also be useful when reporting a problem.
A second "d" option will enable extended debugging, showing you all the data that was parsed from the config file, instead of just the most important things. More specifically, this will add all the mode lines and the font selection list to the debug output.
-h
prints out a short help and the version number.
-r
don't run the ResetProg.
When a ResetProg is defined (and thus enabled) from the config file, SVGATextMode, without "-r", will attempt to run it whenever it has changed the screen size.
The reset program is normally used to signal or restart a program that depends on the current screen size, and that doesn't react to the SIGWINCH signal the kernel sends it upon a screen resize. Typical examples are gpm and selection; two very handy textmode-mouse handlers.
Resizing the screen from 80x25 to e.g. 116x48 without telling gpm or selection about it, will cause the mouse cursor to get stuck in the upper left 80x25 characters of the screen.
The "-r" option is useful when SVGATextMode is started from the system initialisation files (/etc/rc.d/...), because many of the programs that need to be reset through the ResetProg have not yet been started, so trying to send them signals, or trying to kill them, would fail. And trying to restart them would cause two copies of the same program running when the rest of the rc-files start them up.
-f
don't run the FontProg. When the font loader is enabled through the LoadFont option in the config file, SVGATextMode will not run it, even when the screen is resized. When this option is not enabled and the font loader is enabled, SVGATextMode will run an external program to load a suitable font.
-c
don't program the pixel clock. More of a debugging option. If you suspect that SVGATextMode fails to program your VGA clock properly, then this option programs everything else except the pixel clock, which is left at its old value. Some laptops don't react to well when the pixel clock is reprogrammed, so this option can help there, too.
-v
don't validate H/V frequencies. Normally SVGATextMode will check the horizontal frequency and the vertical refresh of the new mode against the ranges specified in the config file, and refuse to program a mode that doesn't fall within those limits. This option turns off that checking, and will program ANY mode, even if the config file says your monitor cannot handle them.
-s
scan mode. SVGATextMode will scan the entire config file, and will dump a listing of all valid modes for your configuration, taking the limits for vertical refresh, horizontal scan rate, maximum text mode pixel clock and availability of the required clock frequency (if you don't have a programmable clock chip) for your VGA card / monitor configuration into account. When combined with the -v option, it will dump all modes, whether they are allowed or not.
This is particularly useful to create input to a script or program that lets you (for example) select a text mode from a menu.
-m
allow trying to resize screen via a 1x1 screen. This option is only useful when you get an out of memory error when resizing the screen. Normally SVGATextMode will just exit and tell you there was not enough memory. The best thing to do then is to free some memory. If that is impossible for some reason, this option will first resize the screen to a 1x1 size to free the memory already taken up by all the consoles, and then resize to the desired size.
WARNING: see the BUGS section for more information on the potential dangers of this method. Do not use this option unless it is absolutely necessary.
-a
always do a full resize. SVGATextMode will normally check with the old screen size to see if the new mode actually resizes the screen (it could just enhance the screen by moving to a larger font, but remain at the same width/height). It does that via the tty settings (those you get when typing "stty -a"). If it detects that the new mode is a different size than the old one, it will run all sorts of extra code to make various system components know about the resizing. But if it thinks no actual resizing has been done, it won't do that.
Under certain circumstances (see the BUGS section), it is desirable to resize the screen, even if the tty settings say the screen already has that size. This option will force the resizing code to "fake" a resize, and run all necessary code (set the tty settings again, tell the kernel about the resizing, and run the optional ResetProg).
-k
Don't tell the kernel if the screen size has changed. If the horizontal screen size really has changed, the kernel will not know about it and render text in completely wrong places. Some people seem to want to use this to lie to the kernel about the amount of text lines on screen, and e.g. use the lower line for a status display (since the kernel doesn't know it's there, it doesn't render text in it).
As a side effect, none of the programs running on the console will be sent a SIGWINCH from the kernel, so they too will not know about the change. The ResetProg is still ran (unless when prohibited by the "-r" option of course), so it could be used to send explicit resize messages to console applications that otherwise relied on the kernel SIGWINCH signal.
-x
always run SVGATextMode, even if you are not running it from a normal VGA textmode console. This disables the "dumb-user protection" that was added to avoid people from messing up their XFree86 display when running SVGATextMode from there. This option is only useful if you know what you're doing. It could be used to try to restore a broken textmode using after the Xserver crashed (in combination with the "-o" option).
-t ConfigFile
This option tells SVGATextMode to use a different configuration file than the default one (/etc/TextConfig).
-o
Force all standard VGA registers to a known textmode state. This is quite useful when some VGA-aware program (X-server, svgalib, ...) crashes or gets killed and leaves the screen in graphics mode.
There's only one problem with this. Most of these types of crashes leave the keyboard in raw (scan-code) mode, and thus you won't be able to type the command to restore text mode... You will have to do a "kbd_mode -a" from a remote terminal first. Unless you add "kbd_mode -a" to the file defined in the "ResetProg" label in the TextConfig file, and have "stm -o" under a mouse button combination with the GPM mouse package.
Another fun-stopper is the extended VGA registers, which this option does _not_ reset, because they are chipset-dependent. This means that the "-o" option might not help at all, depending on how sophisticated your card is. SVGATextMode knows about a few cards and how to kick them back into "normal" mode, but not all (due to lack of documentation and cards to test -- hint, hint).
A small example of how SVGATextMode goes to work: suppose you started up in 80x25 text mode, and wanted to change to a more respectable 116x48 mode with a fine 16-pixel high font (normal 132x43 modes from the BIOS are only 8 to 11 pixels high, and the difference is incredible), and extra-wide spacing (using 9-pixel wide characters instead of 8).
Now suppose you have a mode description line in the config file that looks like this:
"Super116x48" 75 928 968 1104 1192 768 775 776 800 font 9x16
(the entire config line must be on a single line)
After correctly configuring the /etc/TextConfig file for your VGA card, typing
SVGATextMode Super116x48
will produce an output similar to the following:
Chipset = 'S3', Textmode clock = 75.00 MHz, 116x48 chars, CharCell = 9x16. Refresh = 55.93kHz/69.9Hz.
Loading 8x16 font from file /usr/share/consolefonts/Cyr_a8x16
Note the refresh timings at the end of the first output line: this mode would require an SVGA monitor capable of 56 kHz at 70 Hz (the same frequencies as a VESA 1024x768 @ 70 HZ mode).
The second output line actually comes from setfont, a program which SVGATextMode can be made to call automatically after resizing the screen, so the font is adjusted to the available space in the character cell.
In order to be able to do anything, SVGATextMode must be run by the superuser, or it must be setuid root.
Having SVGATextMode installed with the SETUID bits ON makes it run as root, even when a non-root user runs it. This is a potential security problem, since SVGATextMode can be made to execute external programs (font loader and ResetProg).
The default distribution will NOT renounce superuser rights EVER, so it'll run any external program as root also (if the setuid bits on SVGATextMode are on, of course). If you are administering a critical system, don't set the SETUID bits on SVGATextMode (which will have the side effect that non-root users cannot use SVGATextMode), or if you do, make sure that all externally called programs are secure.
If you want to have the SUID bits on, but don't trust the external program's security, then recompiling SVGATextMode with the compile-time option "RUN_SECURE" enabled will make SVGATextMode renounce superuser rights immediately after requesting rights to write to the VGA registers. Any program run thereafter will be run with the user ID of the one executing SVGATextMode.
If the programs called by SVGATextMode are not setuid root, they might fail, because they want to change things only root is allowed to tamper with.
There is a DOS version of all SVGATextMode tools (including SVGATextMode itself) which may be built from the source distribution.
The stm.exe program will do the same, and require the same as SVGATextMode does under Linux, with the following exceptions:
The TextConfig file is in \etc\textconf. Note the lack of a drive letter. You have to execute stm.exe from the same drive the textconf file is on. Otherwise, use the -t option to specify a full textconf file path.
No font loading (yet?). Do not enable the "loadfont" option in the textconf file. It will not work: there is no DOS font loader included in the SVGATextMode distribution. This basically means you are limited to modes that still work with the same font you started with. There are no doubt numerous font loaders available for DOS that could solve this problem.
Stm.exe is really of limited use. DOS was not designed to have flexible screen sizes (DOS was not designed - period. DOS was patched). DOS programs follow the same route. Some DOS programs assume a certain screen size (like 80x25). Many assume at least a constant screen width (80 chars). Only a few support all screen sizes without trouble. You can expect DOS versions of UNIX tools to be of the last kind (like the editor joe.exe).
Running stm.exe in a Windows DOS box IS possible, although you must remain 80 chars wide, or Windows will report that "due to the way this program uses the VGA, it must be run full-screen". If you run stm.exe to change from a 80x25 screen to a 80x50 screen, the DOS box will auto-resize to the new height.
/etc/TextConfig
The (default) configuration file for SVGATextMode
/usr/sbin/SVGATextMode
The main text mode manipulation program described here
-k since Debian 4.0 (Etch);
-o since Debian 2.0 (Hamm);
-x since Debian 4.0 (Etch).