tech-install archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: amd64/i386 boot(8): New 'conspeed' command to set baud rate



This time with cvs diff that applies...

Index: share/man/man8/man8.x86/boot.8
===================================================================
RCS file: /cvsroot/src/share/man/man8/man8.x86/boot.8,v
retrieving revision 1.20
diff -u -p -r1.20 boot.8
--- share/man/man8/man8.x86/boot.8	16 Sep 2019 01:57:58 -0000	1.20
+++ share/man/man8/man8.x86/boot.8	8 May 2020 14:18:27 -0000
@@ -363,6 +363,8 @@ flag in
 .Va boothowto .
 Boot the system in silent mode.
 .El
+.It Ic conspeed Va speed
+Set the console device baud rate.
 .It Ic consdev Va dev
 Immediately switch the console to the specified device
 .Va dev
Index: share/man/man8/man8.x86/boot_console.8
===================================================================
RCS file: /cvsroot/src/share/man/man8/man8.x86/boot_console.8,v
retrieving revision 1.4
diff -u -p -r1.4 boot_console.8
--- share/man/man8/man8.x86/boot_console.8	18 Feb 2017 21:39:53 -0000	1.4
+++ share/man/man8/man8.x86/boot_console.8	8 May 2020 14:18:27 -0000
@@ -138,10 +138,3 @@ The serial communication parameters (byt
 not settable (either at compile time or run time).
 The default parameters are
 .Dq "8 N 1" .
-.Pp
-The baud rate is not settable when using BIOS I/O.
-It should be settable at compile time with
-.Dq Dv CONSPEED
-just as it is when using
-.Dq Dv DIRECT_SERIAL .
-The default speed is 9600 baud (the maximum for BIOS I/O).
Index: sys/arch/i386/stand/boot/boot2.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/stand/boot/boot2.c,v
retrieving revision 1.73
diff -u -p -r1.73 boot2.c
--- sys/arch/i386/stand/boot/boot2.c	4 Apr 2020 19:50:54 -0000	1.73
+++ sys/arch/i386/stand/boot/boot2.c	8 May 2020 14:18:29 -0000
@@ -129,6 +129,7 @@ void	command_quit(char *);
 void	command_boot(char *);
 void	command_pkboot(char *);
 void	command_dev(char *);
+void	command_conspeed(char *);
 void	command_consdev(char *);
 #ifndef SMALL
 void	command_menu(char *);
@@ -146,6 +147,7 @@ const struct bootblk_command commands[] 
 	{ "boot",	command_boot },
 	{ "pkboot",	command_pkboot },
 	{ "dev",	command_dev },
+	{ "conspeed",	command_conspeed },
 	{ "consdev",	command_consdev },
 #ifndef SMALL
 	{ "menu",	command_menu },
@@ -449,6 +451,7 @@ command_help(char *arg)
 	       "ls [dev:][path]\n"
 #endif
 	       "dev [dev:]\n"
+	       "conspeed {speed}\n"
 	       "consdev {pc|com[0123]|com[0123]kbd|auto}\n"
 	       "vesa {modenum|on|off|enabled|disabled|list}\n"
 #ifndef SMALL
@@ -560,6 +563,22 @@ command_dev(char *arg)
 		default_part_name = default_devname + 5;
 }
 
+void
+command_conspeed(char *arg)
+{
+	char *ep;
+	uint32_t conspeed;
+
+	errno = 0;
+	conspeed = strtoul(arg, &ep, 10);
+	if (ep == arg || *ep != '\0' || errno) {
+		printf("invalid console speed.\n");
+		return;
+	}
+
+	boot_params.bp_conspeed = conspeed;
+}
+
 static const struct cons_devs {
 	const char	*name;
 	u_int		tag;


Home | Main Index | Thread Index | Old Index