summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lkm/syscons/daemon/Makefile9
-rw-r--r--lkm/syscons/daemon/daemon_saver.c215
-rw-r--r--sys/dev/syscons/daemon/daemon_saver.c215
-rw-r--r--sys/modules/syscons/daemon/Makefile9
-rw-r--r--sys/modules/syscons/daemon/daemon_saver.c215
5 files changed, 663 insertions, 0 deletions
diff --git a/lkm/syscons/daemon/Makefile b/lkm/syscons/daemon/Makefile
new file mode 100644
index 0000000..57526c0
--- /dev/null
+++ b/lkm/syscons/daemon/Makefile
@@ -0,0 +1,9 @@
+# $Id$
+
+KMOD= daemon_saver_mod
+SRCS= daemon_saver.c
+
+NOMAN=
+CFLAGS+= -DLKM -I${.CURDIR}/.. -I${.CURDIR}/../../../sys
+
+.include <bsd.kmod.mk>
diff --git a/lkm/syscons/daemon/daemon_saver.c b/lkm/syscons/daemon/daemon_saver.c
new file mode 100644
index 0000000..d189c59
--- /dev/null
+++ b/lkm/syscons/daemon/daemon_saver.c
@@ -0,0 +1,215 @@
+/*-
+ * Copyright (c) 1997 Sandro Sigala, Brescia, Italy.
+ * Copyright (c) 1995 S ren Schmidt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/errno.h>
+
+#include <machine/md_var.h>
+
+#include "saver.h"
+
+MOD_MISC(daemon_saver);
+
+void (*current_saver)(int blank);
+void (*old_saver)(int blank);
+
+#define DAEMON_MAX_WIDTH 32
+#define DAEMON_MAX_HEIGHT 19
+
+/* How is the author of this ASCII pic? */
+
+static char *daemon_pic[] = {
+ " , ,",
+ " /( )`",
+ " \\ \\___ / |",
+ " /- _ `-/ '",
+ " (/\\/ \\ \\ /\\",
+ " / / | ` \\",
+ " O O ) / |",
+ " `-^--'`< '",
+ " (_.) _ ) /",
+ " `.___/` /",
+ " `-----' /",
+ "<----. __ / __ \\",
+ "<----|====O)))==) \\) /====",
+ "<----' `--' `.__,' \\",
+ " | |",
+ " \\ / /\\",
+ " ______( (_ / \\______/",
+ " ,' ,-----' |",
+ " `--{__________)",
+ NULL
+};
+
+static char *daemon_attr[] = {
+ " R R",
+ " RR RR",
+ " R RRRR R R",
+ " RR W RRR R",
+ " RWWW W R RR",
+ " W W W R R",
+ " B B W R R",
+ " WWWWWWRR R",
+ " RRRR R R R",
+ " RRRRRRR R",
+ " RRRRRRR R",
+ "YYYYYY RR R RR R",
+ "YYYYYYYYYYRRRRYYR RR RYYYY",
+ "YYYYYY RRRR RRRRRR R",
+ " R R",
+ " R R RR",
+ " CCCCCCR RR R RRRRRRRR",
+ " CC CCCCCCC C",
+ " CCCCCCCCCCCCCCC",
+ NULL
+};
+
+
+static void
+draw_daemon(int xpos, int ypos)
+{
+ int x, y;
+ int attr;
+
+ for (y = 0; daemon_pic[y] != NULL; y++)
+ for (x = 0; daemon_pic[y][x] != '\0'; x++) {
+ switch (daemon_attr[y][x]) {
+ case 'R': attr = (FG_LIGHTRED|BG_BLACK)<<8; break;
+ case 'Y': attr = (FG_YELLOW|BG_BLACK)<<8; break;
+ case 'B': attr = (FG_LIGHTBLUE|BG_BLACK)<<8; break;
+ case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break;
+ case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break;
+ default: attr = (FG_WHITE|BG_BLACK)<<8; break;
+ }
+ *((u_short *)(Crtat + (ypos + y)*cur_console->xsize
+ + xpos + x)) = scr_map[daemon_pic[y][x]]|attr;
+ }
+}
+
+static void
+draw_string(int xpos, int ypos, char *s, int len)
+{
+ int x;
+
+ for (x = 0; x < len; x++)
+ *((u_short*)(Crtat + ypos*cur_console->xsize + xpos + x)) =
+ scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
+}
+
+static void
+daemon_saver(int blank)
+{
+ static const char message[] = {"FreeBSD 3.0 CURRENT"};
+ static int dxpos = 0, dypos = 0;
+ static int dxdir = 1, dydir = 1;
+ static int txpos = 10, typos = 10;
+ static int txdir = -1, tydir = -1;
+ static int moved_daemon = 0;
+ scr_stat *scp = cur_console;
+
+ if (blank) {
+ if (scrn_blanked++ < 2)
+ return;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
+ scp->xsize * scp->ysize);
+ set_border(0);
+ scrn_blanked = 1;
+
+ if (++moved_daemon) {
+ if (dxdir > 0) {
+ if (dxpos + 1 >= scp->xsize - DAEMON_MAX_WIDTH)
+ dxdir = -1;
+ } else {
+ if (dxpos == 0) dxdir = 1;
+ }
+ if (dydir > 0) {
+ if (dypos + 1 >= scp->ysize - DAEMON_MAX_HEIGHT
+)
+ dydir = -1;
+ } else {
+ if (dypos == 0) dydir = 1;
+ }
+ moved_daemon = -1;
+ dxpos += dxdir; dypos += dydir;
+ }
+
+ if (txdir > 0) {
+ if (txpos + 1 >= scp->xsize - sizeof(message)-1)
+ txdir = -1;
+ } else {
+ if (txpos == 0) txdir = 1;
+ }
+ if (tydir > 0) {
+ if (typos + 1 >= scp->ysize - 1)
+ tydir = -1;
+ } else {
+ if (typos == 0) tydir = 1;
+ }
+ txpos += txdir; typos += tydir;
+
+ draw_daemon(dxpos, dypos);
+ draw_string(txpos, typos, (char *)message, sizeof(message)-1);
+ } else {
+ if (scrn_blanked) {
+ set_border(scp->border);
+ scrn_blanked = 0;
+ scp->start = 0;
+ scp->end = scp->xsize * scp->ysize;
+ }
+ }
+}
+
+static int
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ old_saver = current_saver;
+ current_saver = daemon_saver;
+ return 0;
+}
+
+static int
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ current_saver = old_saver;
+ return 0;
+}
+
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/dev/syscons/daemon/daemon_saver.c b/sys/dev/syscons/daemon/daemon_saver.c
new file mode 100644
index 0000000..d189c59
--- /dev/null
+++ b/sys/dev/syscons/daemon/daemon_saver.c
@@ -0,0 +1,215 @@
+/*-
+ * Copyright (c) 1997 Sandro Sigala, Brescia, Italy.
+ * Copyright (c) 1995 S ren Schmidt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/errno.h>
+
+#include <machine/md_var.h>
+
+#include "saver.h"
+
+MOD_MISC(daemon_saver);
+
+void (*current_saver)(int blank);
+void (*old_saver)(int blank);
+
+#define DAEMON_MAX_WIDTH 32
+#define DAEMON_MAX_HEIGHT 19
+
+/* How is the author of this ASCII pic? */
+
+static char *daemon_pic[] = {
+ " , ,",
+ " /( )`",
+ " \\ \\___ / |",
+ " /- _ `-/ '",
+ " (/\\/ \\ \\ /\\",
+ " / / | ` \\",
+ " O O ) / |",
+ " `-^--'`< '",
+ " (_.) _ ) /",
+ " `.___/` /",
+ " `-----' /",
+ "<----. __ / __ \\",
+ "<----|====O)))==) \\) /====",
+ "<----' `--' `.__,' \\",
+ " | |",
+ " \\ / /\\",
+ " ______( (_ / \\______/",
+ " ,' ,-----' |",
+ " `--{__________)",
+ NULL
+};
+
+static char *daemon_attr[] = {
+ " R R",
+ " RR RR",
+ " R RRRR R R",
+ " RR W RRR R",
+ " RWWW W R RR",
+ " W W W R R",
+ " B B W R R",
+ " WWWWWWRR R",
+ " RRRR R R R",
+ " RRRRRRR R",
+ " RRRRRRR R",
+ "YYYYYY RR R RR R",
+ "YYYYYYYYYYRRRRYYR RR RYYYY",
+ "YYYYYY RRRR RRRRRR R",
+ " R R",
+ " R R RR",
+ " CCCCCCR RR R RRRRRRRR",
+ " CC CCCCCCC C",
+ " CCCCCCCCCCCCCCC",
+ NULL
+};
+
+
+static void
+draw_daemon(int xpos, int ypos)
+{
+ int x, y;
+ int attr;
+
+ for (y = 0; daemon_pic[y] != NULL; y++)
+ for (x = 0; daemon_pic[y][x] != '\0'; x++) {
+ switch (daemon_attr[y][x]) {
+ case 'R': attr = (FG_LIGHTRED|BG_BLACK)<<8; break;
+ case 'Y': attr = (FG_YELLOW|BG_BLACK)<<8; break;
+ case 'B': attr = (FG_LIGHTBLUE|BG_BLACK)<<8; break;
+ case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break;
+ case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break;
+ default: attr = (FG_WHITE|BG_BLACK)<<8; break;
+ }
+ *((u_short *)(Crtat + (ypos + y)*cur_console->xsize
+ + xpos + x)) = scr_map[daemon_pic[y][x]]|attr;
+ }
+}
+
+static void
+draw_string(int xpos, int ypos, char *s, int len)
+{
+ int x;
+
+ for (x = 0; x < len; x++)
+ *((u_short*)(Crtat + ypos*cur_console->xsize + xpos + x)) =
+ scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
+}
+
+static void
+daemon_saver(int blank)
+{
+ static const char message[] = {"FreeBSD 3.0 CURRENT"};
+ static int dxpos = 0, dypos = 0;
+ static int dxdir = 1, dydir = 1;
+ static int txpos = 10, typos = 10;
+ static int txdir = -1, tydir = -1;
+ static int moved_daemon = 0;
+ scr_stat *scp = cur_console;
+
+ if (blank) {
+ if (scrn_blanked++ < 2)
+ return;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
+ scp->xsize * scp->ysize);
+ set_border(0);
+ scrn_blanked = 1;
+
+ if (++moved_daemon) {
+ if (dxdir > 0) {
+ if (dxpos + 1 >= scp->xsize - DAEMON_MAX_WIDTH)
+ dxdir = -1;
+ } else {
+ if (dxpos == 0) dxdir = 1;
+ }
+ if (dydir > 0) {
+ if (dypos + 1 >= scp->ysize - DAEMON_MAX_HEIGHT
+)
+ dydir = -1;
+ } else {
+ if (dypos == 0) dydir = 1;
+ }
+ moved_daemon = -1;
+ dxpos += dxdir; dypos += dydir;
+ }
+
+ if (txdir > 0) {
+ if (txpos + 1 >= scp->xsize - sizeof(message)-1)
+ txdir = -1;
+ } else {
+ if (txpos == 0) txdir = 1;
+ }
+ if (tydir > 0) {
+ if (typos + 1 >= scp->ysize - 1)
+ tydir = -1;
+ } else {
+ if (typos == 0) tydir = 1;
+ }
+ txpos += txdir; typos += tydir;
+
+ draw_daemon(dxpos, dypos);
+ draw_string(txpos, typos, (char *)message, sizeof(message)-1);
+ } else {
+ if (scrn_blanked) {
+ set_border(scp->border);
+ scrn_blanked = 0;
+ scp->start = 0;
+ scp->end = scp->xsize * scp->ysize;
+ }
+ }
+}
+
+static int
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ old_saver = current_saver;
+ current_saver = daemon_saver;
+ return 0;
+}
+
+static int
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ current_saver = old_saver;
+ return 0;
+}
+
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
diff --git a/sys/modules/syscons/daemon/Makefile b/sys/modules/syscons/daemon/Makefile
new file mode 100644
index 0000000..57526c0
--- /dev/null
+++ b/sys/modules/syscons/daemon/Makefile
@@ -0,0 +1,9 @@
+# $Id$
+
+KMOD= daemon_saver_mod
+SRCS= daemon_saver.c
+
+NOMAN=
+CFLAGS+= -DLKM -I${.CURDIR}/.. -I${.CURDIR}/../../../sys
+
+.include <bsd.kmod.mk>
diff --git a/sys/modules/syscons/daemon/daemon_saver.c b/sys/modules/syscons/daemon/daemon_saver.c
new file mode 100644
index 0000000..d189c59
--- /dev/null
+++ b/sys/modules/syscons/daemon/daemon_saver.c
@@ -0,0 +1,215 @@
+/*-
+ * Copyright (c) 1997 Sandro Sigala, Brescia, Italy.
+ * Copyright (c) 1995 S ren Schmidt
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer
+ * in this position and unchanged.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id$
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+#include <sys/errno.h>
+
+#include <machine/md_var.h>
+
+#include "saver.h"
+
+MOD_MISC(daemon_saver);
+
+void (*current_saver)(int blank);
+void (*old_saver)(int blank);
+
+#define DAEMON_MAX_WIDTH 32
+#define DAEMON_MAX_HEIGHT 19
+
+/* How is the author of this ASCII pic? */
+
+static char *daemon_pic[] = {
+ " , ,",
+ " /( )`",
+ " \\ \\___ / |",
+ " /- _ `-/ '",
+ " (/\\/ \\ \\ /\\",
+ " / / | ` \\",
+ " O O ) / |",
+ " `-^--'`< '",
+ " (_.) _ ) /",
+ " `.___/` /",
+ " `-----' /",
+ "<----. __ / __ \\",
+ "<----|====O)))==) \\) /====",
+ "<----' `--' `.__,' \\",
+ " | |",
+ " \\ / /\\",
+ " ______( (_ / \\______/",
+ " ,' ,-----' |",
+ " `--{__________)",
+ NULL
+};
+
+static char *daemon_attr[] = {
+ " R R",
+ " RR RR",
+ " R RRRR R R",
+ " RR W RRR R",
+ " RWWW W R RR",
+ " W W W R R",
+ " B B W R R",
+ " WWWWWWRR R",
+ " RRRR R R R",
+ " RRRRRRR R",
+ " RRRRRRR R",
+ "YYYYYY RR R RR R",
+ "YYYYYYYYYYRRRRYYR RR RYYYY",
+ "YYYYYY RRRR RRRRRR R",
+ " R R",
+ " R R RR",
+ " CCCCCCR RR R RRRRRRRR",
+ " CC CCCCCCC C",
+ " CCCCCCCCCCCCCCC",
+ NULL
+};
+
+
+static void
+draw_daemon(int xpos, int ypos)
+{
+ int x, y;
+ int attr;
+
+ for (y = 0; daemon_pic[y] != NULL; y++)
+ for (x = 0; daemon_pic[y][x] != '\0'; x++) {
+ switch (daemon_attr[y][x]) {
+ case 'R': attr = (FG_LIGHTRED|BG_BLACK)<<8; break;
+ case 'Y': attr = (FG_YELLOW|BG_BLACK)<<8; break;
+ case 'B': attr = (FG_LIGHTBLUE|BG_BLACK)<<8; break;
+ case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break;
+ case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break;
+ default: attr = (FG_WHITE|BG_BLACK)<<8; break;
+ }
+ *((u_short *)(Crtat + (ypos + y)*cur_console->xsize
+ + xpos + x)) = scr_map[daemon_pic[y][x]]|attr;
+ }
+}
+
+static void
+draw_string(int xpos, int ypos, char *s, int len)
+{
+ int x;
+
+ for (x = 0; x < len; x++)
+ *((u_short*)(Crtat + ypos*cur_console->xsize + xpos + x)) =
+ scr_map[s[x]]|(FG_LIGHTGREEN|BG_BLACK)<<8;
+}
+
+static void
+daemon_saver(int blank)
+{
+ static const char message[] = {"FreeBSD 3.0 CURRENT"};
+ static int dxpos = 0, dypos = 0;
+ static int dxdir = 1, dydir = 1;
+ static int txpos = 10, typos = 10;
+ static int txdir = -1, tydir = -1;
+ static int moved_daemon = 0;
+ scr_stat *scp = cur_console;
+
+ if (blank) {
+ if (scrn_blanked++ < 2)
+ return;
+ fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], Crtat,
+ scp->xsize * scp->ysize);
+ set_border(0);
+ scrn_blanked = 1;
+
+ if (++moved_daemon) {
+ if (dxdir > 0) {
+ if (dxpos + 1 >= scp->xsize - DAEMON_MAX_WIDTH)
+ dxdir = -1;
+ } else {
+ if (dxpos == 0) dxdir = 1;
+ }
+ if (dydir > 0) {
+ if (dypos + 1 >= scp->ysize - DAEMON_MAX_HEIGHT
+)
+ dydir = -1;
+ } else {
+ if (dypos == 0) dydir = 1;
+ }
+ moved_daemon = -1;
+ dxpos += dxdir; dypos += dydir;
+ }
+
+ if (txdir > 0) {
+ if (txpos + 1 >= scp->xsize - sizeof(message)-1)
+ txdir = -1;
+ } else {
+ if (txpos == 0) txdir = 1;
+ }
+ if (tydir > 0) {
+ if (typos + 1 >= scp->ysize - 1)
+ tydir = -1;
+ } else {
+ if (typos == 0) tydir = 1;
+ }
+ txpos += txdir; typos += tydir;
+
+ draw_daemon(dxpos, dypos);
+ draw_string(txpos, typos, (char *)message, sizeof(message)-1);
+ } else {
+ if (scrn_blanked) {
+ set_border(scp->border);
+ scrn_blanked = 0;
+ scp->start = 0;
+ scp->end = scp->xsize * scp->ysize;
+ }
+ }
+}
+
+static int
+daemon_saver_load(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ old_saver = current_saver;
+ current_saver = daemon_saver;
+ return 0;
+}
+
+static int
+daemon_saver_unload(struct lkm_table *lkmtp, int cmd)
+{
+ (*current_saver)(0);
+ current_saver = old_saver;
+ return 0;
+}
+
+int
+daemon_saver_mod(struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(daemon_saver, lkmtp, cmd, ver,
+ daemon_saver_load, daemon_saver_unload, lkm_nullcmd);
+}
OpenPOWER on IntegriCloud