tech-install archive

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

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



Hi,

PCengines[0] apuX serial console work at 115200 baud rate alone.
During installation, a disconnect and reconnect of serial console
(to the installer default 9600) after the consdev selection is
required. This diff lets user set the baud rate as required at
boot(8) prompt.

[0] https://pcengines.ch

diff -r cd817d59e064 share/man/man8/man8.x86/boot.8
--- a/share/man/man8/man8.x86/boot.8	Wed May 06 09:18:10 2020 +0000
+++ b/share/man/man8/man8.x86/boot.8	Thu May 07 18:57:56 2020 +0530
@@ -363,6 +363,8 @@
 .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
diff -r cd817d59e064 share/man/man8/man8.x86/boot_console.8
--- a/share/man/man8/man8.x86/boot_console.8	Wed May 06 09:18:10 2020 +0000
+++ b/share/man/man8/man8.x86/boot_console.8	Thu May 07 18:57:56 2020 +0530
@@ -138,10 +138,3 @@
 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).
diff -r cd817d59e064 sys/arch/i386/stand/boot/boot2.c
--- a/sys/arch/i386/stand/boot/boot2.c	Wed May 06 09:18:10 2020 +0000
+++ b/sys/arch/i386/stand/boot/boot2.c	Thu May 07 18:57:56 2020 +0530
@@ -129,6 +129,7 @@
 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 @@
 	{ "boot",	command_boot },
 	{ "pkboot",	command_pkboot },
 	{ "dev",	command_dev },
+	{ "conspeed",	command_conspeed },
 	{ "consdev",	command_consdev },
 #ifndef SMALL
 	{ "menu",	command_menu },
@@ -449,6 +451,7 @@
 	       "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 @@
 		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