Subject: port-i386/7418: dual head PCs using CONSDEV_COM can be confusing to lusers
To: None <gnats-bugs@gnats.netbsd.org>
From: Daniel Hagerty <hag@linnaean.org>
List: netbsd-bugs
Date: 04/18/1999 22:11:16
>Number:         7418
>Category:       port-i386
>Synopsis:       dual head PCs using CONSDEV_COM can be confusing to lusers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer (NetBSD/i386 Portmaster)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 18 22:05:01 1999
>Last-Modified:
>Originator:     Daniel Hagerty
>Organization:
Maybe
>Release:        netbsd-1.4_ALPHA
>Environment:
System: NetBSD neuralgia.linnaean.org 1.4_ALPHA NetBSD 1.4_ALPHA (NEURALGIA.v6) #63: Fri Apr 16 23:22:26 EDT 1999 hag@neuralgia.linnaean.org:/fs/neuralgia/home/hag/src/ipv6/netbsd-1.4-sys/arch/i386/compile/NEURALGIA.v6 i386


>Description:
	x86 boxes that have a standard video console that have been
configured with CONSDEV_COM can confuse lusers.  Machines configured
this way give no indication of being functional on the video console
until they reach multiuser by default.

>How-To-Repeat:
	Configure box with CONSDEV_COM.  Boot.  Observe video
screen not changing from what BIOS did until multiuser.

>Fix:
	Attached patch adds yet another #ifdef option for the serial
bootloader.  If COMCONS_PCMSG is defined, a brief message will be
printed on the video console if a serial console is selected for boot.

Index: pcio.c
===================================================================
RCS file: /home/neuralgia/hag/work/hacking/os/netbsd/cvsroot/netbsd/sys/arch/i386/stand/lib/pcio.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 pcio.c
--- pcio.c	1999/04/15 11:08:20	1.1.1.2
+++ pcio.c	1999/04/19 04:45:21
@@ -70,6 +70,10 @@
 #define SERIAL_ARG (iodev - CONSDEV_COM0)
 #endif /* DIRECT_SERIAL */
 
+#ifdef COMCONS_PCMSG
+static inline void conputs __P((char *));
+#endif COMCONS_PCMSG
+
 static int getcomaddr __P((int));
 #endif /* SUPPORT_SERIAL */
 
@@ -190,8 +194,19 @@
 		iodev = CONSDEV_PC;
 		break;
 	}
+
 	conputc('\015');
 	conputc('\n');
+
+#ifdef COMCONS_PCMSG
+	if(iodev != CONSDEV_PC) {
+	  int sdev = iodev;
+	  iodev = CONSDEV_PC;
+	  conputs("\r\nBooting with serial console...\r\n\r\n");
+	  iodev = sdev;
+	}
+#endif
+
 	strncpy(btinfo_console.devname, iodev == CONSDEV_PC ? "pc" : "com", 16);
 #if defined(DIRECT_SERIAL) && defined(CONSPEED)
 	btinfo_console.speed = CONSPEED;
@@ -318,3 +333,14 @@
 
 	return(c);
 }
+
+#ifdef COMCONS_PCMSG
+static inline void
+conputs(char *msg) {
+  char c;
+
+  while((c = *msg++)) {
+    conputc(c);
+  }
+}
+#endif
>Audit-Trail:
>Unformatted: