Re: VC corruption, easy to reproduce with 2.0.0 to 2.0.0pl2

Bryn Paul Arnold Jones (bpaj@gytha.demon.co.uk)
Sat, 22 Jun 1996 23:08:24 +0100 (BST)


On Sat, 22 Jun 1996, Hasdi R Hashim wrote:

> On Sat, 22 Jun 1996, Aaron Tiensivu wrote:
> > This happens to me all the time when switching between a normal Linux console
> > prompt [like at a bash command line] and DOSEMU running Turbo C++... this also
> > happens to me with SVGALib programs.
> >
> > I have to switch...wait....switch-back..
> >
> > If I do it too quickly, I have to logon with my terminal and kill the offending
> > program.
>
> Make sense. There's nothing much you can do about it. Problem is video
> memory can only be used by one program at one time (obvious isn't it:).
> When, you switch out of svgalib program, the program will save screen
> state, switch, and wait. Every 1 second it checks to see if it has been
> switched back (via ioctl(2) and sleep(3)). If it has, it restores the
> screen state. The saving and restoring of screen state is *critical*. If
> you switch out when it is restoring state, or switch in when it is saving
> state... ack!
>
> This is what I understand from the svgalib sources. Feel free to correct
> me.
>

Hmm, perhaps the programs in question should sleep at least a second
before even tring to switch back to graphics modes, ie check via ioctl,
sleep 1 sec, check again, switch, and like wise with switching out, of
graphics: switch to textmode, check (we're on the colsole), sleep, check
again (still there), switch to graphics here. This will slow the
switches down, but hopefully we'll not have as meny stuck in insane
states problems. Also the programs should continue with the switch until
they have finnished, and only then start switching back (ie a
SIGINT/SIGSTOP/SIGKILL/... wont automatically start a clean up routine,
while we're switching).

> Just for kicks, try running two svga programs at the same time. Try to
> time your switching so that restore comes after save not in the middle....
> :) :) :)
>

> The problem with svgalib/dosemu/X is that multiple processes are fighting
> between one video memory. There has to be some sort locking mechanism for
> this or only allow one program to access the video memory. You won't get
> this problem in DOS since only one process can be running at one time. :/
>

Well mostly if they wern't so eager to start using the video memory, and
made sure that they actually had it, it might not be such a problem ....

> Regards,
>
> Hasdi
>
> Lignux, the choice of the Nu generation.
>

No NEVER

>
Bryn

--
PGP key pass phrase forgotten,   \ Overload -- core meltdown sequence 
again :(                          |            initiated.
                                 / This space is intentionally left   
                                |  blank, apart from this text ;-)
                                 \____________________________________