Module Name:    src
Committed By:   martin
Date:           Wed Jul 15 15:54:50 UTC 2020

Modified Files:
        src/share/man/man8/man8.x86 [netbsd-8]: boot.8
        src/sys/arch/i386/stand/boot [netbsd-8]: boot2.c

Log Message:
Pull up following revision(s) (requested by kim in ticket #1575):

        sys/arch/i386/stand/boot/boot2.c: revision 1.74
        share/man/man8/man8.x86/boot.8: revision 1.21

Let consdev command also set speed
Adapted from PR install/55490 by Sunil Nimmagadda

Document optional speed argument to consdev


To generate a diff of this commit:
cvs rdiff -u -r1.11.4.4 -r1.11.4.5 src/share/man/man8/man8.x86/boot.8
cvs rdiff -u -r1.66.10.1 -r1.66.10.2 src/sys/arch/i386/stand/boot/boot2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man8/man8.x86/boot.8
diff -u src/share/man/man8/man8.x86/boot.8:1.11.4.4 src/share/man/man8/man8.x86/boot.8:1.11.4.5
--- src/share/man/man8/man8.x86/boot.8:1.11.4.4	Wed Sep 18 17:30:05 2019
+++ src/share/man/man8/man8.x86/boot.8	Wed Jul 15 15:54:50 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: boot.8,v 1.11.4.4 2019/09/18 17:30:05 martin Exp $
+.\"	$NetBSD: boot.8,v 1.11.4.5 2020/07/15 15:54:50 martin Exp $
 .\"
 .\" Copyright (c) 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"     @(#)boot_i386.8	8.2 (Berkeley) 4/19/94
 .\"
-.Dd September 13, 2019
+.Dd July 15, 2020
 .Dt BOOT 8 x86
 .Os
 .Sh NAME
@@ -363,7 +363,7 @@ flag in
 .Va boothowto .
 Boot the system in silent mode.
 .El
-.It Ic consdev Va dev
+.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
 Immediately switch the console to the specified device
 .Va dev
 and reprint the banner.
@@ -379,6 +379,17 @@ See
 .Sx Console Selection Policy
 in
 .Xr x86/boot_console 8 .
+.Pp
+A
+.Va speed
+for the serial port is optional and defaults to 9600.
+If a value of zero is specified, then the current baud rate (set by the
+BIOS) will be used.
+Setting the
+.Va speed
+with the
+.Ar pc
+device is not possible.
 .It Ic dev Op Va device
 Set the default drive and partition for subsequent file system
 operations.

Index: src/sys/arch/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.66.10.1 src/sys/arch/i386/stand/boot/boot2.c:1.66.10.2
--- src/sys/arch/i386/stand/boot/boot2.c:1.66.10.1	Tue Sep 17 18:26:53 2019
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Jul 15 15:54:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.66.10.1 2019/09/17 18:26:53 martin Exp $	*/
+/*	$NetBSD: boot2.c,v 1.66.10.2 2020/07/15 15:54:50 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -440,7 +440,7 @@ command_help(char *arg)
 	       "ls [dev:][path]\n"
 #endif
 	       "dev [dev:]\n"
-	       "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
+	       "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n"
 	       "vesa {modenum|on|off|enabled|disabled|list}\n"
 #ifndef SMALL
 	       "menu (reenters boot menu, if defined in boot.cfg)\n"
@@ -563,14 +563,32 @@ void
 command_consdev(char *arg)
 {
 	const struct cons_devs *cdp;
+	char *sep;
+	int speed;
+
+	sep = strchr(arg, ',');
+	if (sep != NULL)
+		*sep++ = '\0';
 
 	for (cdp = cons_devs; cdp->name; cdp++) {
-		if (strcmp(arg, cdp->name) == 0) {
-			initio(cdp->tag);
-			print_banner();
-			return;
+		if (strcmp(arg, cdp->name) != 0)
+			continue;
+
+		if (sep != NULL) {
+			if (cdp->tag == CONSDEV_PC)
+				goto error;
+
+			speed = atoi(sep);
+			if (speed < 0)
+				goto error;
+			boot_params.bp_conspeed = speed;
 		}
+
+		initio(cdp->tag);
+		print_banner();
+		return;
 	}
+error:
 	printf("invalid console device.\n");
 }
 

Reply via email to