Re: Space for improvements

Search this archive.

From: Matan Ziv-Av (matan@svgalib.org)
Date: Tue 07 Mar 2000 - 12:09:00 IST


Hi, 

first, about the console switch problem, the problem is apparently in
your code, since svgalib seems to work. Here's a simple program that
tests the behaviour you discuss:

#include <vga.h>
int main()
{
        int i;
        char *c;

        vga_init();
        vga_setmode(G640x480x64K);
        c=vga_getgraphmem();
        vga_setpage(1);
        for(i=0;i<32767;i++)*(c+i)=0x51;
        vga_getch();
        for(i=32768;i<65536;i++)*(c+i)=0x52;
        vga_getch();
        vga_setmode(TEXT);
}

You can easily see that svgalib does work correctly. 


On Mon, 6 Mar 2000, Karel Kulhavy wrote:

> I think about I could improve SVGAlib's stability by consuming some effort to hack
> insde it.
> 
> I noticed that
> 

> 1)When SVGAlib is starting and I VT switch, Linux sometimes crashes
> (or at least the screen)

Maybe this can be solved by capturing the vt at the beginning of init 
process, and not allowing switches until the init process is finished.


> 2)Wild VT switching during SVGAlib running causes damaged palette
> and unability of SVGAlib application to continue displaying correctly

If you use versions 1.4.2, or 1.9.*, this should not happen. You should
see a "This should not happen" message and the program will exit
cleanly. This happens when a switch to svgalib's vt, then from it, and
then back to it (or the other way around) is so swift, that svgalib does
not have time to register and handle the switch away event, so it think
there were two "switch to svgalib" events in succession, which is of
course impossible. The solution is again to disable console switching at
the very beginning of trying to handle console switches, but it is a bit
more complicated.

> 3)Wild VT switching during SVGAlib run causes some other VTs's
> filled with all 255, I guess (or some other uniform garbage)

This is the same problem as the previous one.

> Please advise me what I should study to comprehend how Linux kernel
> VT switches work and what signals are sent where etc.

Look at svgalib's switching code (some in vga.c, mostly in vgabgvt.c).

> I noticed the problem 3) at X Server (X was running on VT and text
> on all other VT's, no SVGAlib in the system!) on extermely loaded
> 386 machine. Is it a bug of Linux Kernel or the X Server & SVGAlib?

Not a bug, a feature. Handling vt switches from user space is hard, and
not reliable, so you can't have a very robust system until all handling
is done in the kernel, but if you look at kgi and fbdev, you will see
that this route is not easy as well.

-- 
Matan Ziv-Av.                         matan@svgalib.org


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST