Skip site navigation (1)Skip section navigation (2)
Date:      27 Jan 1998 13:21:31 +0100
From:      dag-erli@ifi.uio.no (Dag-Erling Coidan Smørgrav)
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!)
Message-ID:  <xzp90s2umyc.fsf@hrotti.ifi.uio.no>
In-Reply-To: Joel Ray Holveck's message of "Mon, 26 Jan 1998 23:29:27 -0600 (CST)"
References:  <16061.885755982.1@time.cdrom.com> <xzpk9bnfvkz.fsf@gjallarhorn.ifi.uio.no> <199801270529.XAA04108@detlev.UUCP>

next in thread | previous in thread | raw e-mail | index | archive | help
Joel Ray Holveck <joelh@gnu.org> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzp90s2umyc.fsf>