This FAQ, and the message board are intended to answer questions regarding use of svgalib. If you have questions regarding svgalib programming, they are not answered in this FAQ, and they should be asked on the svgalib mailing list (see Q.12), rather than on the message board.
This answer needs to be very long, but here is the short version.
The answer is long, and not very definite, since svgalib (like XFree86, ggi and fbdev) supports graphics cards according to the graphic chipset they use. The problem is that some chipsets are used in many cards, and sometimes the cards are different from each other in a way that a driver that works with one card won't work with another card which has the same chipset.
In addition, there are a few levels of support by svgalib (using modelines or a fixed set of mode, autodetecting or not, supporting linear modes or not, etc.)
chipset VESAto the config file (usually /etc/vga/libvga.config).
As was explained in the previous question, it is hard to tell. All supported cards should be autodetected, so try without any chipset line in the config file, and if that does not work, then the card is probably not supported. You can then try the VESA driver.
Please make sure that you are using the latest release of svgalib (you can find what it is at svgalib homepage). Many distribuitions include an old version of svgalib, so this point is important. You might even want to look at the latest development release, to see if there are any changes to the driver of the chipset you use.
Also, make sure the problem is indeed not with the program you try to run, but actually with svgalib: run the program vgatest. The first lines of the output should list the chipset that was found and the amount of memory detected. Then, there will be a list of all modes supported by the combination of chipset, driver and monitor. select a mode number, and that mode will be set, and a test pattern will be displayed. Pressing any key will return to text mode.
If the wrong chipset is reported, or a mode that is listed is not set properly, or a similar problem, please report the bug by email to svgalib maintainer.
See previous question. Check with vgatest if the problem is with svgalib or the program you run, and report to the appropriate person.
This can usually be solved by adding the line
VesaTextto the config file (usually /etc/vga/libvga.config).
This problem occures with some systems, and I have not yet found out why. Sometime it is solved when upgrading a kernel or a libc (or a mainboard), but don't do this with the expectation that it will solve the problem, since it usually does not. An exception is the Matrox Millenium, where upgrade of the card's bios to the latest version is known to make it work with the vesa driver.
If you want to make sure if the problem is in svgalib, or the mysterious problem I described, please run the program vbetest (only available in the lrmi-0.6m subdirectory of the svgalib source distribution). If vbtest can set modes and return to text mode, but still, the vesa driver does not work, than it is a bug in svgalib, so please report it. Otherwise, it is the unknown problem.
svgalib programs need to be run as root. This means that either the user that runs them is root, or, if running by normal users is desirable, the program needs to be 'suid root', which means: the program must be owned by root (chown 0 program) and the suid bit needs to be set (chmod u+s program).
If a program is run from an xterm, or from a telnet session, it cannot display graphics on its console, so svgalib tries to open a new virtual console (if this option is compiled in). Under Linux, only root or the owner of the console can open a new virtual.
svgalib's implementation of background execution relied on a kernel feature (mmapping /proc/self/mem), which was removed in linux-2.3.27, so if you are using any kernel later than that, you need to compile svgalib without bavkground execution support. To do this, edit the file Makefile.cfg, and comment out the line
BACKGROUND = Yso it will read:
#BACKGROUND = YThen recompile and reinstall svgalib.
Not all drivers use modelines. Some old drivers don't, and mainly, the VESA driver does not. If you use the VESA driver, you can only use the modes defined in the VESA bios, in the refresh rate defined in the VESA bios. Most bios writers choose to use the lowest refresh, so that the mode will work even on old monitors.
The svgalib mailing list is used to discuss svgalib. The main topics are svgalib development and application development using svgalib, but any question related to svgalib is welcome. The mailing list does not have a FAQ yet, but it is archived, so if you fear that you question might be frequent, browse the archive first. To subscribe, send a message with the content "subscribe linux-svgalib" to email@example.com