Subject: Re: solution for garbage characters problem...
To: Brian Stark <bstark@siemens-psc.com>
From: Matthias Drochner <drochner@zel459.zel.kfa-juelich.de>
List: port-i386
Date: 08/07/1999 14:05:58
bstark@siemens-psc.com said:
> To get rid of the garbage screen simply edit /etc/rc.conf and change
> the default value for wscons from NO to YES. Then restart your system.
> That's it. There are no changes necessary for /etc/ttys, /etc/
> wscons.conf, /etc/rc.wscons, or even the kernel.  

I think I've found the reason behind this:
The X servers don't save the whole text memory of a VGA card but only the
first 4096 characters. This is enough for standard text screens located at
the begginning of the text memory.
pccons did only use the first 4k, so there was no problem. More advanced
drivers like pcvt and wscons/vga optimize scrolling by moving the screen
origin around in text memory instead of copying the contents. Since pcvt
creates 8 virtual screens per default and the screen switching saved
and restored the screen contents anyway, it was not noticed if the X server
didn't restore the contents on exit.
wscons with "wscons=YES" in rc.conf switches virtual screens similar
to pcvt, so no garbage is seen. If run with a single screen however,
the driver soesn't save and restore its contents, so random garbage
appears if the text screen was scrolled out of the first 4k of
display memory.
Here is a patch which makes the X server save the whole VGA text memory:

Index: vgaHW.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/xfree86/vga256/vga/vgaHW.c,v
retrieving revision 1.1.1.5
diff -c -2 -r1.1.1.5 vgaHW.c
*** vgaHW.c	1999/01/19 22:22:38	1.1.1.5
--- vgaHW.c	1999/08/07 11:43:53
***************
*** 94,98 ****
  
  /* bytes per plane to save for text */
! #if defined(Lynx) || defined(linux) || defined(MINIX)
  #define TEXT_AMOUNT 16384
  #else
--- 94,98 ----
  
  /* bytes per plane to save for text */
! #if defined(Lynx) || defined(linux) || defined(MINIX) || defined(__NetBSD__)
  #define TEXT_AMOUNT 16384
  #else


best regards
Matthias