Re: SMALL bug

Colin Plumb (
Fri, 25 Oct 96 22:37:12 MDT

Charlie Ross wrote:

> Not even really a bug, just a curriocity...
> Console in text mode...
> for some reason, about one in every 100 times the console scrolls, it wont
> scroll cleanly, ie, text will flash (almost subliminally) where text
> shouldnt be...

Kelly French theorized:

> I believe linux sets the video card to display different portions of
> video memory. This would remove the need to 'scroll' the screen in
> video memory (which is relatively slow). It looks like the kernel is
> getting confused by some situation and displaying the wrong part of the
> buffer on the screen. When the next new-line is sent, the correct
> portion of the buffer is displayed (thus, it flashes instead of
> pauses).

Yes, Linux does indeed use the hardware start-of-display pointer feature
to avoid copying large amouts of text around. It just uses video memory
as a circular buffer and programs the video hardware to display the
right portion of the circular buffer.

The problem is that programming the hardware is not atomic (it takes
several steps) and if the video hardware starts to display a screen
while the programming is halfway complete, it will take half of the old
pointer, half of the new pointer, and put them together to make
something bizarre which it will then display for 1/60 of a second.

It's not the next newline when the screen fixes itself, but the
next frame the video card displays, leading to the very brief
flickering of the errors.

Unfortunately, there is no easy way to tell when it's safe to
reprogram the video card registers, so the penalty for very fast
screen update is occasional flickers of glitch. I think it's
a worthwhile tradeoff, myself.