[comp.os.minix] Expanation for EGA scrolling bug

brucee@runx.ips.oz (Bruce Evans) (03/05/88)

Hardware scrolling on EGA cards has never worked properly on Minix. The
explanation seems to be that the hardware which scans the video buffer
doesn't automatically wrap around at offset 16K (or even 32K). The
situation is different for all of the standard video cards:

               memory buffer size   wrap-around size
MDA (Mono)             4K                 4K (?)
HGC (Hercules)         32K (+)            4K
CGA (Color)            16K                16K
EGA (Enhanced)         32K                n/a (?)
VGA (Video)            32K                n/a

(+) optionally another 32K in which attributes don't work properly.
(?) infered from reading sources and bug reports.
n/a data between the starting scan address and the end of the memory buffer
    is scanned. Remaining data does not come from the start of the memory
    buffer. It probably comes from memory on the adapter not currently
    in the processor's address space.

Thus, standard CGA code on the VGA causes groups of
		(16*1024 - 25*80*2)/(80*2) = 77.4
lines to be displayed OK, followed by 25 blank lines which magically re-appear
when the video origin wraps from 16K-2 to 0.

Hardware scrolling can still be used, provided every 78th line is done with
a special software scroll which resets the video origin to 0. It may be
tricky to avoid a glitch when this is done. Perhaps the wrap-around can
be reprogrammed instead.

Even now the HGC shows glitches with both the old and new tty drivers.
I have modified the video origin code and removed some of these. I
think it may only be safe to modify the pair of video origin registers
on the 6845 both during the same retrace period. Doing this would
involve watching a retrace bit (depends on the adaptor) and locking out
interrupts (messes up multitasking).

Bruce Evans
Internet: brucee@runx.ips.oz.au    UUCP: uunet!runx.ips.oz.au!brucee