Wed Jul 15 15:54:50 2020 UTC ()
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


(martin)
diff -r1.11.4.4 -r1.11.4.5 src/share/man/man8/man8.x86/boot.8
diff -r1.66.10.1 -r1.66.10.2 src/sys/arch/i386/stand/boot/boot2.c

cvs diff -r1.11.4.4 -r1.11.4.5 src/share/man/man8/man8.x86/boot.8 (expand / switch to unified diff)

--- src/share/man/man8/man8.x86/boot.8 2019/09/18 17:30:05 1.11.4.4
+++ src/share/man/man8/man8.x86/boot.8 2020/07/15 15:54:50 1.11.4.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: boot.8,v 1.11.4.4 2019/09/18 17:30:05 martin Exp $ 1.\" $NetBSD: boot.8,v 1.11.4.5 2020/07/15 15:54:50 martin Exp $
2.\" 2.\"
3.\" Copyright (c) 1991, 1993 3.\" Copyright (c) 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
5.\" 5.\"
6.\" This code is derived from software written and contributed 6.\" This code is derived from software written and contributed
7.\" to Berkeley by William Jolitz. 7.\" to Berkeley by William Jolitz.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -22,27 +22,27 @@ @@ -22,27 +22,27 @@
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94 33.\" @(#)boot_i386.8 8.2 (Berkeley) 4/19/94
34.\" 34.\"
35.Dd September 13, 2019 35.Dd July 15, 2020
36.Dt BOOT 8 x86 36.Dt BOOT 8 x86
37.Os 37.Os
38.Sh NAME 38.Sh NAME
39.Nm boot 39.Nm boot
40.Nd 40.Nd
41system bootstrapping procedures 41system bootstrapping procedures
42.Sh DESCRIPTION 42.Sh DESCRIPTION
43Intel Architecture, 32-bit (IA-32) computers (the 43Intel Architecture, 32-bit (IA-32) computers (the
44.Tn IBM PC 44.Tn IBM PC
45and its clones) 45and its clones)
46that can run 46that can run
47.Nx Ns /i386 47.Nx Ns /i386
48or 48or
@@ -353,42 +353,53 @@ Boot the system in verbose mode. @@ -353,42 +353,53 @@ Boot the system in verbose mode.
353.It Fl x 353.It Fl x
354Sets the 354Sets the
355.Sy AB_DEBUG 355.Sy AB_DEBUG
356flag in 356flag in
357.Va boothowto . 357.Va boothowto .
358Boot the system with debug messages enabled. 358Boot the system with debug messages enabled.
359.It Fl z 359.It Fl z
360Sets the 360Sets the
361.Sy AB_SILENT 361.Sy AB_SILENT
362flag in 362flag in
363.Va boothowto . 363.Va boothowto .
364Boot the system in silent mode. 364Boot the system in silent mode.
365.El 365.El
366.It Ic consdev Va dev 366.It Ic consdev Va dev Ns Oo Ns , Ns Va speed Oc
367Immediately switch the console to the specified device 367Immediately switch the console to the specified device
368.Va dev 368.Va dev
369and reprint the banner. 369and reprint the banner.
370.Va dev 370.Va dev
371must be one of 371must be one of
372.\" .Bl -item -width com[0123]kbd -offset indent -compact 372.\" .Bl -item -width com[0123]kbd -offset indent -compact
373.Ar pc , com0 , com1 , com2 , 373.Ar pc , com0 , com1 , com2 ,
374.Ar com3 , com0kbd , com1kbd , com2kbd , 374.Ar com3 , com0kbd , com1kbd , com2kbd ,
375.Ar com3kbd , 375.Ar com3kbd ,
376or 376or
377.Ar auto . 377.Ar auto .
378See 378See
379.Sx Console Selection Policy 379.Sx Console Selection Policy
380in 380in
381.Xr x86/boot_console 8 . 381.Xr x86/boot_console 8 .
 382.Pp
 383A
 384.Va speed
 385for the serial port is optional and defaults to 9600.
 386If a value of zero is specified, then the current baud rate (set by the
 387BIOS) will be used.
 388Setting the
 389.Va speed
 390with the
 391.Ar pc
 392device is not possible.
382.It Ic dev Op Va device 393.It Ic dev Op Va device
383Set the default drive and partition for subsequent file system 394Set the default drive and partition for subsequent file system
384operations. 395operations.
385Without an argument, print the current setting. 396Without an argument, print the current setting.
386.Va device 397.Va device
387is of the form specified in 398is of the form specified in
388.Cm boot . 399.Cm boot .
389.It Ic fs Va file 400.It Ic fs Va file
390Load a file system image from the specified 401Load a file system image from the specified
391.Ar file , 402.Ar file ,
392and request the kernel to use it as the root file system. 403and request the kernel to use it as the root file system.
393The 404The
394.Xr makefs 8 405.Xr makefs 8

cvs diff -r1.66.10.1 -r1.66.10.2 src/sys/arch/i386/stand/boot/boot2.c (expand / switch to unified diff)

--- src/sys/arch/i386/stand/boot/boot2.c 2019/09/17 18:26:53 1.66.10.1
+++ src/sys/arch/i386/stand/boot/boot2.c 2020/07/15 15:54:50 1.66.10.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: boot2.c,v 1.66.10.1 2019/09/17 18:26:53 martin Exp $ */ 1/* $NetBSD: boot2.c,v 1.66.10.2 2020/07/15 15:54:50 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -430,27 +430,27 @@ command_help(char *arg) @@ -430,27 +430,27 @@ command_help(char *arg)
430#ifndef NO_RAIDFRAME 430#ifndef NO_RAIDFRAME
431 " dev syntax is (hd|fd|cd|raid)[N[x]]\n" 431 " dev syntax is (hd|fd|cd|raid)[N[x]]\n"
432#else 432#else
433 " dev syntax is (hd|fd|cd)[N[x]]n" 433 " dev syntax is (hd|fd|cd)[N[x]]n"
434#endif 434#endif
435#ifndef NO_GPT 435#ifndef NO_GPT
436 " or NAME=gpt_label\n" 436 " or NAME=gpt_label\n"
437#endif 437#endif
438 " (ex. \"hd0a:netbsd.old -s\")\n" 438 " (ex. \"hd0a:netbsd.old -s\")\n"
439#if LIBSA_ENABLE_LS_OP 439#if LIBSA_ENABLE_LS_OP
440 "ls [dev:][path]\n" 440 "ls [dev:][path]\n"
441#endif 441#endif
442 "dev [dev:]\n" 442 "dev [dev:]\n"
443 "consdev {pc|com[0123]|com[0123]kbd|auto}\n" 443 "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n"
444 "vesa {modenum|on|off|enabled|disabled|list}\n" 444 "vesa {modenum|on|off|enabled|disabled|list}\n"
445#ifndef SMALL 445#ifndef SMALL
446 "menu (reenters boot menu, if defined in boot.cfg)\n" 446 "menu (reenters boot menu, if defined in boot.cfg)\n"
447#endif 447#endif
448 "modules {on|off|enabled|disabled}\n" 448 "modules {on|off|enabled|disabled}\n"
449 "load {path_to_module}\n" 449 "load {path_to_module}\n"
450 "multiboot [dev:][filename] [<args>]\n" 450 "multiboot [dev:][filename] [<args>]\n"
451 "splash {path_to_image_file}\n" 451 "splash {path_to_image_file}\n"
452 "userconf {command}\n" 452 "userconf {command}\n"
453 "rndseed {path_to_rndseed_file}\n" 453 "rndseed {path_to_rndseed_file}\n"
454 "help|?\n" 454 "help|?\n"
455 "quit\n"); 455 "quit\n");
456} 456}
@@ -553,34 +553,52 @@ static const struct cons_devs { @@ -553,34 +553,52 @@ static const struct cons_devs {
553 { "com3", CONSDEV_COM3 }, 553 { "com3", CONSDEV_COM3 },
554 { "com0kbd", CONSDEV_COM0KBD }, 554 { "com0kbd", CONSDEV_COM0KBD },
555 { "com1kbd", CONSDEV_COM1KBD }, 555 { "com1kbd", CONSDEV_COM1KBD },
556 { "com2kbd", CONSDEV_COM2KBD }, 556 { "com2kbd", CONSDEV_COM2KBD },
557 { "com3kbd", CONSDEV_COM3KBD }, 557 { "com3kbd", CONSDEV_COM3KBD },
558 { "auto", CONSDEV_AUTO }, 558 { "auto", CONSDEV_AUTO },
559 { NULL, 0 } 559 { NULL, 0 }
560}; 560};
561 561
562void 562void
563command_consdev(char *arg) 563command_consdev(char *arg)
564{ 564{
565 const struct cons_devs *cdp; 565 const struct cons_devs *cdp;
 566 char *sep;
 567 int speed;
 568
 569 sep = strchr(arg, ',');
 570 if (sep != NULL)
 571 *sep++ = '\0';
566 572
567 for (cdp = cons_devs; cdp->name; cdp++) { 573 for (cdp = cons_devs; cdp->name; cdp++) {
568 if (strcmp(arg, cdp->name) == 0) { 574 if (strcmp(arg, cdp->name) != 0)
569 initio(cdp->tag); 575 continue;
570 print_banner(); 576
571 return; 577 if (sep != NULL) {
 578 if (cdp->tag == CONSDEV_PC)
 579 goto error;
 580
 581 speed = atoi(sep);
 582 if (speed < 0)
 583 goto error;
 584 boot_params.bp_conspeed = speed;
572 } 585 }
 586
 587 initio(cdp->tag);
 588 print_banner();
 589 return;
573 } 590 }
 591error:
574 printf("invalid console device.\n"); 592 printf("invalid console device.\n");
575} 593}
576 594
577#ifndef SMALL 595#ifndef SMALL
578/* ARGSUSED */ 596/* ARGSUSED */
579void 597void
580command_menu(char *arg) 598command_menu(char *arg)
581{ 599{
582 600
583 if (bootcfg_info.nummenu > 0) { 601 if (bootcfg_info.nummenu > 0) {
584 /* Does not return */ 602 /* Does not return */
585 doboottypemenu(); 603 doboottypemenu();
586 } else { 604 } else {