tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
patches to optionally clear the screen during boot.
Currently the x86 boot code clears the screen which seems un-unix like
and unnecessary. This patch makes the behavior optional via boot.conf.
Anon Ymous wrote it. Ok to commit?
christos
Index: boot/boot2.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
retrieving revision 1.40
diff -u -r1.40 boot2.c
--- boot/boot2.c 25 Nov 2008 13:23:54 -0000 1.40
+++ boot/boot2.c 13 Dec 2008 20:55:22 -0000
@@ -239,6 +239,9 @@
void
print_banner(void)
{
+ if (bootconf.clear)
+ clear_pc_screen();
+
#ifndef SMALL
int n;
if (bootconf.banner[0]) {
@@ -271,7 +274,6 @@
char c;
twiddle_toggle = 1; /* no twiddling until we're ready */
- printf("\f"); /* clear screen (hopefully) */
initio(boot_params.bp_consdev);
Index: dosboot/main.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/dosboot/main.c,v
retrieving revision 1.24
diff -u -r1.24 main.c
--- dosboot/main.c 26 Sep 2008 14:12:49 -0000 1.24
+++ dosboot/main.c 13 Dec 2008 20:34:41 -0000
@@ -216,6 +216,8 @@
int extmem = getextmem();
char *s = "";
+ clear_pc_screen();
+
#ifdef XMS
u_long xmsmem;
if (getextmem1() == 0 && (xmsmem = checkxms()) != 0) {
Index: lib/bootmenu.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/lib/bootmenu.c,v
retrieving revision 1.1
diff -u -r1.1 bootmenu.c
--- lib/bootmenu.c 25 Nov 2008 13:23:54 -0000 1.1
+++ lib/bootmenu.c 13 Dec 2008 20:49:52 -0000
@@ -81,6 +81,7 @@
* default: the default menu option to use if Return is pressed
* consdev: the console device to use
* format: how menu choices are displayed: (a)utomatic, (n)umbers or (l)etters
+ * clear: whether to clear the screen or not
*
* Example boot.cfg file:
* banner=Welcome to NetBSD
@@ -110,7 +111,10 @@
/* automatically switch between letter and numbers on menu */
bootconf.menuformat = MENUFORMAT_AUTO;
-
+#if 0
+ /* XXX - clear the screen by default? */
+ bootconf.clear = 1;
+#endif
fd = open(BOOTCONF, 0);
if (fd < 0)
return;
@@ -214,6 +218,8 @@
bootconf.menuformat = MENUFORMAT_LETTER;
break;
}
+ } else if (!strncmp(key, "clear", 5)) {
+ bootconf.clear = atoi(value) != 0;
}
}
switch (bootconf.menuformat) {
Index: lib/bootmenu.h
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/lib/bootmenu.h,v
retrieving revision 1.1
diff -u -r1.1 bootmenu.h
--- lib/bootmenu.h 25 Nov 2008 13:23:54 -0000 1.1
+++ lib/bootmenu.h 13 Dec 2008 16:45:13 -0000
@@ -47,6 +47,7 @@
int nummenu; /* Number of menu items */
int timeout; /* Timeout in seconds */
int menuformat; /* Print letters instead of numbers? */
+ int clear; /* Clear the screen? */
} extern bootconf;
#endif /* !_BOOTMENU_H */
Index: lib/libi386.h
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/lib/libi386.h,v
retrieving revision 1.27
diff -u -r1.27 libi386.h
--- lib/libi386.h 19 Nov 2008 12:36:41 -0000 1.27
+++ lib/libi386.h 13 Dec 2008 20:30:33 -0000
@@ -55,6 +55,7 @@
void reboot(void);
void gateA20(void);
+void clear_pc_screen(void);
void initio(int);
#define CONSDEV_PC 0
#define CONSDEV_COM0 1
Index: lib/pcio.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/lib/pcio.c,v
retrieving revision 1.23
diff -u -r1.23 pcio.c
--- lib/pcio.c 21 May 2008 13:36:45 -0000 1.23
+++ lib/pcio.c 13 Dec 2008 20:59:25 -0000
@@ -87,6 +87,16 @@
#endif
void
+clear_pc_screen(void)
+{
+#ifdef SUPPORT_SERIAL
+ /* Clear the screen if we are on a glass tty. */
+ if (iodev == CONSDEV_PC)
+ conclr();
+#endif
+}
+
+void
initio(int dev)
{
#ifdef SUPPORT_SERIAL
@@ -201,10 +211,6 @@
conputc('\n');
strncpy(btinfo_console.devname, iodev == CONSDEV_PC ? "pc" : "com", 16);
- if (iodev == CONSDEV_PC) {
- /* Clear screen if on a glass tty. */
- conclr();
- }
#else /* !SUPPORT_SERIAL */
btinfo_console.devname[0] = 'p';
btinfo_console.devname[1] = 'c';
Index: netboot/main.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/netboot/main.c,v
retrieving revision 1.12
diff -u -r1.12 main.c
--- netboot/main.c 26 Sep 2008 14:12:50 -0000 1.12
+++ netboot/main.c 13 Dec 2008 20:35:59 -0000
@@ -76,6 +76,7 @@
static void
print_banner(void)
{
+ clear_pc_screen();
printf("\n"
">> %s, Revision %s (from NetBSD %s)\n"
Index: pxeboot/main.c
===================================================================
RCS file: /s/NetBSD/cvsroot/src/sys/arch/i386/stand/pxeboot/main.c,v
retrieving revision 1.16
diff -u -r1.16 main.c
--- pxeboot/main.c 25 Nov 2008 13:23:54 -0000 1.16
+++ pxeboot/main.c 13 Dec 2008 20:37:17 -0000
@@ -91,6 +91,9 @@
int base = getbasemem();
int ext = getextmem();
+ if (bootconf.clear)
+ clear_pc_screen();
+
printf("\n"
">> NetBSD/x86 PXE boot, Revision %s (from NetBSD %s)\n"
">> Memory: %d/%d k\n",
Home |
Main Index |
Thread Index |
Old Index