From owner-freebsd-hackers Tue Jan 27 04:21:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA07481 for hackers-outgoing; Tue, 27 Jan 1998 04:21:44 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA07476 for ; Tue, 27 Jan 1998 04:21:39 -0800 (PST) (envelope-from dag-erli@ifi.uio.no) Received: from hrotti.ifi.uio.no (2602@hrotti.ifi.uio.no [129.240.64.15]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id NAA24819; Tue, 27 Jan 1998 13:21:35 +0100 (MET) Received: (from dag-erli@localhost) by hrotti.ifi.uio.no ; Tue, 27 Jan 1998 13:21:33 +0100 (MET) To: joelh@gnu.org Cc: hackers@FreeBSD.ORG Subject: Re: File I/O in kernel land (was: Re: 2nd warning: 2.2.6 BETA begins in 10 days!) References: <16061.885755982.1@time.cdrom.com> <199801270529.XAA04108@detlev.UUCP> Organization: Gutteklubben Terrasse X-url: http://www.ifi.uio.no/~dag-erli/ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit From: dag-erli@ifi.uio.no (Dag-Erling Coidan Smørgrav) Date: 27 Jan 1998 13:21:31 +0100 In-Reply-To: Joel Ray Holveck's message of "Mon, 26 Jan 1998 23:29:27 -0600 (CST)" Message-ID: Lines: 95 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk Joel Ray Holveck writes: > > With that in mind, I have a "bouncing logo" screen saver lkm (think > > daemon_saver_mod crossed with splashkit) I'd like to submit. However, > Is this graphical, or textual? Graphical. If I wanted a text-mode logo I'd use daemon_saver... OK, I'm having some trouble with the lkm with which you guys may be able to help me out. At first I thought it was a bug in my code, but I've gone over it very carefully, and I'm quite certain now that the problem is in syscons. The problem is that scrn_timer() doesn't seem to be called when the console is in VGA mode. I tried to comment out the graphics code and simply blank the screen in text mode, and it works perfectly. I added a call to log() which logs every call to logo_saver(); I get something like 20-30 log messages a second (which seems reasonable since scrn_timer() sets the timer to approximately 25 hz). When I uncomment the VGA code (which was taken from splashkit), logo_saver() is called only twice: once when the screen saver hits in, and once when it is unloaded. The console responds to keypresses, and I can type commands at the shell prompt, but the screen saver never gets the message to switch back to text mode. The kernel log shows only two messages. Here's the relevant excerpt: static void logo_saver(int blank) { struct scr_stat *scp; static u_char save_mode; static int xpos = 0, ypos = 0; static int xinc = 1, yinc = 1; u_char *s = logo_img, *d; int pl, y; #ifndef NDEBUG log(LOG_DEBUG, "logo_saver(%d) scrn_blanked = %d\n", blank, scrn_blanked); #endif scp = cur_console; if (!blank) /* Restore screen */ { if (scrn_blanked <= 0) return; #ifndef JUSTBLANK pl = splhigh(); scp->mode = save_mode; scp->status &= ~UNKNOWN_MODE; set_mode(scp); load_palette(palette); splx(pl); #endif scrn_blanked = 0; #ifndef NDEBUG log(LOG_DEBUG, "out\n"); #endif return; } if (scrn_blanked <= 0) /* Just switched on, so set mode */ { #ifndef NDEBUG log(LOG_DEBUG, "in\n"); #endif scrn_blanked++; #ifndef JUSTBLANK pl = splhigh(); save_mode = scp->mode; scp->mode = M_VGA_CG320; scp->status |= UNKNOWN_MODE; set_mode(scp); load_palette((char *)logo_pal); splx(pl); bzero((void *)pa_to_va(VIDEOMEM), SCRW * SCRH); #else bzero((void *)Crtat, 80 * 25 * 2); return; #endif } /* Turn when you hit the edge */ if ((xpos + logow + xinc > SCRW) || (xpos + xinc < 0)) xinc = -xinc; if ((ypos + logoh + yinc > SCRH) || (ypos + yinc < 0)) yinc = -yinc; xpos += xinc; ypos += yinc; /* XXX Relies on margin around logo to erase trail */ d = (u_char *)pa_to_va(VIDEOMEM) + SCRW * ypos + xpos; for (y = 0; y < logoh; y++, d += SCRW, s += logoll) bcopy((void *)s, (void *)d, logow); } -- * Finrod (INTJ) * Unix weenie * dag-erli@ifi.uio.no * cellular +47-92835919 * RFC1123: "Be liberal in what you accept, and conservative in what you send"