From owner-freebsd-hackers Thu Oct 23 19:58:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA15785 for hackers-outgoing; Thu, 23 Oct 1997 19:58:13 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from bugs.us.dell.com (bugs.us.dell.com [143.166.169.147]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id TAA15724 for ; Thu, 23 Oct 1997 19:57:45 -0700 (PDT) (envelope-from tony@dell.com) Received: from moth.us.dell.com (moth.us.dell.com [143.166.169.152]) by bugs.us.dell.com (8.6.12/8.6.12) with SMTP id VAA10425 for ; Thu, 23 Oct 1997 21:57:06 -0500 Message-Id: <3.0.3.32.19971023215701.006dc4b0@bugs.us.dell.com> X-Sender: tony@bugs.us.dell.com X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.3 (32) Date: Thu, 23 Oct 1997 21:57:01 -0500 To: hackers@FreeBSD.ORG From: Tony Overfield Subject: fixes for syscons.c and daemon_saver.c In-Reply-To: <199710221007.MAA01578@curry.mchp.siemens.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk While playing with the Dancin' Daemon screen saver, I noticed three minor problems. 1. On some video cards (S3 Trio64 based ones at least), there is a continuous, but brief, video glitch that mars the beauty of the screen saver. It is caused by continuously updating the border color, which briefly (for several pixel clocks) sets the pixel data to the border color. This should be a black glitch, but for some reason, it's producing a short blue glitch on the Trio64 based cards. One possible fix (in set_border() (syscons.c)): Change this: outb(ATC, 0x11); outb(ATC, color); inb(crtc_addr + 6); /* reset flip-flop */ outb(ATC, 0x20); /* enable Palette */ to this: outb(ATC, 0x31); outb(ATC, color); This keeps valid pixel data from being replaced by the contents of the overscan register. Alternate (or additional) fix (in daemon_saver() (daemon_saver.c)): Change code to call set_border(0) only once, like this: if (blank) { if (scrn_blanked == 0) set_border(0); if (scrn_blanked++ < 2) return; fillw( .... ); /* set_border(0); */ 2. Switching video modes from VGA_80x50 to VGA_80x25 (and etc.) can allow the Daemon and the hostname strings to wander far off the edge of the screen, crashing the kernel after a short time. This happens because the dimensions of the screen can change after the static position variables have been moved outside the new screen dimensions. Suggested fix: Change the code (in daemon_saver() (daemon_saver.c)) to make inequality boundary crossing checks, like this: if (dxpos >= scp->xsize - DAEMON_MAX_WIDTH) instead of: if (dxpos == scp->xsize - DAEMON_MAX_WIDTH) (repeat this 7 more times) The code should also force the txpos, typos, dxpos, dypos variables to all be in range, though this change will get them back in range fairly quickly. The draw_string(... message ...) stuff doesn't work right when the message string is longer than the width of the screen, which is easy to do in VGA_40x25 mode. The fix above doesn't fix this, but it prevents it from trashing the system. 3. syscons.c does not maintain the border color correctly when switching virtual terminals. Suggested fix (in exchange_scr() (syscons.c)): Add: set_border(new_scp->border); - Tony