Subject: Re: Adding bootverbose
To: None <tech-kern@netbsd.org>
From: Jaromír Doleček <dolecek@ibis.cz>
List: tech-kern
Date: 08/08/2000 00:44:00
--ELM965688240-13228-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII

Hi folks,
I've finally finishing the changes. This patch does not include
changes to respective bootblock's 'version' files. It has
been only tested on i386 - I'd really appreciate if people having
one of affected ports would test the change whether it compiles
OK and doesn't break something, and tell me if it's ok or not.

As suggested by people here, I've added also 'bootquiet', which
would be used for extra silent boot.

Note I've merged code handling common boot flags into new shared function
boot_flag(), implemented in <sys/boot_flag.h>. The primary reason
to put it into a header file was so that it can easily
be used by both bootblock code and common kernel source (some
ports parse boot flags in e.g. arch/xxx/machdep.c), and also
to make it possible to inline it.
The function recognizes sum of all non-conflicting flags
accross the ports. Currently, it e.g. supports -m (or RB_MINIROOT)
even on e.g. i386, where it's not actually meaningful
on bootup. I've done it this way to simplify things. If people
think that only flags supported by the port previously should
be recognized, I'll adjust the function appropriately.

Any comments or further hints how to do things better are welcome,
of course. I'd like to pull this into tree later this week or on
beginning of the next one, if possible.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
@@@@  Wanna a real operating system ? Go and get NetBSD, damn!  @@@@

--ELM965688240-13228-0_
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: attachment; filename=bootverb.diff

Index: sys/systm.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/systm.h,v
retrieving revision 1.113
diff -u -r1.113 systm.h
--- systm.h	2000/07/14 07:21:22	1.113
+++ systm.h	2000/08/07 21:43:02
@@ -143,6 +143,8 @@
 #endif
 
 extern int boothowto;		/* reboot flags, from console subsystem */
+#define	bootverbose	(boothowto & AB_VERBOSE)
+#define	bootquiet	(boothowto & AB_QUIET)
 
 extern void (*v_putc) __P((int)); /* Virtual console putc routine */
 
Index: sys/reboot.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/reboot.h,v
retrieving revision 1.17
diff -u -r1.17 reboot.h
--- reboot.h	2000/07/29 20:06:30	1.17
+++ reboot.h	2000/08/07 21:43:02
@@ -58,6 +58,14 @@
 #define	RB_POWERDOWN	(RB_HALT|0x800) /* turn power off (or at least halt) */
 
 /*
+ * Extra autoboot flags (passed by boot prog to kernel). See also
+ * macros bootverbose, bootquiet in <sys/systm.h>.
+ */
+#define	AB_NORMAL	0x00000	/* boot normally (default) */
+#define	AB_QUIET	0x10000 /* boot quietly */
+#define	AB_VERBOSE	0x20000	/* boot verbosely */
+
+/*
  * Constants for converting boot-style device number to type,
  * adaptor (uba, mba, etc), unit number and partition number.
  * Type (== major device number) is in the low byte
Index: sys/boot_flag.h
===================================================================
RCS file: boot_flag.h
diff -N boot_flag.h
--- /dev/null	Mon Aug  7 20:55:41 2000
+++ boot_flag.h	Tue Aug  8 00:43:02 2000
@@ -0,0 +1,79 @@
+/* $NetBSD: loadfile.c,v 1.7 1999/12/29 11:08:02 hannken Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the NetBSD
+ *	Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _SYS_BOOT_FLAG_H_
+#define _SYS_BOOT_FLAG_H_
+
+#include <sys/reboot.h>
+
+static __inline int boot_flag(char);
+
+/*
+ * Recognize standard boot arguments. Returns either the associated flag
+ * value or 0 if the argument was not recognized.
+ */
+static __inline int
+boot_flag(char arg)
+{
+	int retval = 0;
+
+	switch (arg) {
+	case 'a': /* ask for file name to boot from */
+		retval = RB_ASKNAME;
+		break;
+	case 'b': /* always halt, never reboot */
+		retval = RB_HALT;
+		break;
+	case 'd': /* break into the kernel debugger ASAP */
+		retval = RB_KDB;
+		break;
+	case 'm': /* mini root present in memory */
+		retval = RB_MINIROOT;
+		break;
+	case 'q': /* boot quietly */
+		retval = AB_QUIET;
+		break;
+	case 's': /* boot to single user */
+		retval = RB_SINGLE;
+		break;
+	case 'v': /* boot verbosely */
+		retval = AB_VERBOSE;
+		break;
+	}
+
+	return retval;
+}
+
+#endif /* _SYS_BOOT_FLAG_H_ */
Index: arch/alpha/alpha/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/alpha/alpha/machdep.c,v
retrieving revision 1.218
diff -u -r1.218 machdep.c
--- machdep.c	2000/07/03 17:52:33	1.218
+++ machdep.c	2000/08/07 21:43:07
@@ -723,6 +723,16 @@
 			boothowto |= RB_SINGLE;
 			break;
 
+		case 'q': /* quiet boot */
+		case 'Q':
+			boothowto |= AB_QUIET;
+			break;
+			
+		case 'v': /* verbose boot */
+		case 'V':
+			boothowto |= AB_VERBOSE;
+			break;
+
 		case '-':
 			/*
 			 * Just ignore this.  It's not required, but it's
Index: arch/amiga/stand/loadbsd/loadbsd.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/amiga/stand/loadbsd/loadbsd.c,v
retrieving revision 1.24
diff -u -r1.24 loadbsd.c
--- loadbsd.c	2000/06/15 13:43:35	1.24
+++ loadbsd.c	2000/08/07 21:43:09
@@ -114,8 +114,9 @@
  *	2.15	07/28/96 is - Add first version of kludges needed to
  *		get FusionForty kickrom'd memory back. Hope this doesn't
  *		break anything else.
+ *	2.16	07/08/00 - added bootverbose support
  */
-static const char _version[] = "$VER: LoadBSD 2.15 (28.7.96)";
+static const char _version[] = "$VER: LoadBSD 2.16 (8.7.2000)";
 
 /*
  * Kernel startup interface version
@@ -202,7 +203,7 @@
 	if ((ExpansionBase=(void *)OpenLibrary(EXPANSIONNAME, 0)) == NULL)
 		err(20, "can't open expansion library");
 
-	while ((ch = getopt(argc, argv, "aAbc:DhI:km:n:ptsSVZ")) != -1) {
+	while ((ch = getopt(argc, argv, "aAbc:DhI:km:n:qptsSvVZ")) != -1) {
 		switch (ch) {
 		case 'k':
 			k_flag = 1;
@@ -227,6 +228,12 @@
 			boothowto &= ~(RB_AUTOBOOT);
 			boothowto |= RB_SINGLE;
 			break;
+		case 'q':
+			boothowto |= AB_QUIET;
+			break
+		case 'v':
+			boothowto |= AB_VERBOSE;
+			break;
 		case 'V':
 			fprintf(stderr,"%s\n",_version + 6);
 			break;
@@ -879,11 +886,13 @@
 \t    segment. The higher priority segment is usually faster
 \t    (i.e. 32 bit memory), but some people have smaller amounts
 \t    of 32 bit memory.
+\t-q  Boot up in quiet mode.
 \t-s  Boot up in singleuser mode (default).
 \t-S  Include kernel symbol table.
 \t-t  This is a *test* option.  It prints out the memory
 \t    list information being passed to the kernel and also
 \t    exits without actually starting NetBSD.
+\t-v  Boot up in verbose mode.
 \t-V  Version of loadbsd program.
 \t-Z  Force kernel load to chipmem.
 HISTORY
Index: arch/arc/arc/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arc/arc/machdep.c,v
retrieving revision 1.42
diff -u -r1.42 machdep.c
--- machdep.c	2000/07/29 20:06:28	1.42
+++ machdep.c	2000/08/07 21:43:13
@@ -550,6 +550,14 @@
 			case 's': /* use serial console */
 				com_console = 1;
 				break;
+
+			case 'q': /* boot quietly */
+				boothowto |= AB_QUIET;
+				break;
+
+			case 'v': /* boot verbosely */
+				boothowto |= AB_VERBOSE;
+				break;
 			}
 
 		}
Index: arch/arm26/boot/BBBB,fd1
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm26/boot/BBBB,fd1,v
retrieving revision 1.3
diff -u -r1.3 BBBB,fd1
--- BBBB,fd1	2000/07/22 15:36:15	1.3
+++ BBBB,fd1	2000/08/07 21:43:14
@@ -68,6 +68,8 @@
           WHEN "a" : howto% = howto% OR &01 : REM RB_ASKNAME
           WHEN "s" : howto% = howto% OR &02 : REM RB_SINGLE
           WHEN "d" : howto% = howto% OR &40 : REM RB_KDB
+          WHEN "q" : howto% = howto% OR &10000 : REM AB_QUIET
+          WHEN "v" : howto% = howto% OR &20000 : REM AB_VERBOSE
           WHEN " ", "" : done% = TRUE
           OTHERWISE : ERROR EXT 0, "Bad option: " + LEFT$(A$, 1)
         ENDCASE
Index: arch/arm32/arm32/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm32/arm32/machdep.c,v
retrieving revision 1.81
diff -u -r1.81 machdep.c
--- machdep.c	2000/06/29 08:52:58	1.81
+++ machdep.c	2000/08/07 21:43:15
@@ -936,6 +936,15 @@
 			memory_disc_size = 2048*1024;
 	}
 #endif	/* NMD && MEMORY_DISK_HOOKS && !MINIROOTSIZE */
+
+	if (get_bootconf_option(args, "quiet", BOOTOPT_TYPE_BOOLEAN, &integer)
+	    || get_bootconf_option(args, "-q", BOOTOPT_TYPE_BOOLEAN, &integer))
+		if (integer)
+			boothowto |= AB_QUIET;
+	if (get_bootconf_option(args, "verbose", BOOTOPT_TYPE_BOOLEAN, &integer)
+	    || get_bootconf_option(args, "-v", BOOTOPT_TYPE_BOOLEAN, &integer))
+		if (integer)
+			boothowto |= AB_VERBOSE;
 }
 
 /* End of machdep.c */
Index: arch/atari/atari/locore.s
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/atari/atari/locore.s,v
retrieving revision 1.70
diff -u -r1.70 locore.s
--- locore.s	2000/06/13 14:48:44	1.70
+++ locore.s	2000/08/07 21:43:20
@@ -776,7 +776,7 @@
 
 	.globl	_C_LABEL(bootversion)
 _C_LABEL(bootversion):
-	.word	0x0002			|  Glues kernel/installboot/loadbsd
+	.word	0x0003			|  Glues kernel/installboot/loadbsd
 					|    and other bootcode together.
 start:
 	movw	#PSL_HIGHIPL,sr		| No interrupts
Index: arch/atari/stand/bootxx/bootxx.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/atari/stand/bootxx/bootxx.c,v
retrieving revision 1.3
diff -u -r1.3 bootxx.c
--- bootxx.c	1998/02/10 10:25:08	1.3
+++ bootxx.c	2000/08/07 21:43:20
@@ -42,6 +42,7 @@
 #include <string.h>
 #include <libkern.h>
 #include <kparamb.h>
+#include <sys/boot_flag.h>
 #include <sys/exec.h>
 #include <sys/reboot.h>
 #include <machine/cpu.h>
@@ -193,9 +194,8 @@
 				od->boothowto &= ~RB_SINGLE;
 			else if (c == 'b')
 				od->boothowto |= RB_ASKNAME;
-			else if (c == 'd')
-				od->boothowto |= RB_KDB;
-			else return(-1);
+			else
+				od->boothowto |= boot_flag(c);
 			break;
 		  case '.':
 			od->ostype = p;
Index: arch/atari/stand/installboot/installboot.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/atari/stand/installboot/installboot.h,v
retrieving revision 1.5
diff -u -r1.5 installboot.h
--- installboot.h	1997/07/09 14:31:14	1.5
+++ installboot.h	2000/08/07 21:43:20
@@ -41,7 +41,7 @@
 /*
  * Should match 'bootversion' in locore.s to make installboot work.
  */
-#define	BOOTVERSION	0x02
+#define	BOOTVERSION	0x03
 
 u_int	dkcksum __P((struct disklabel *));
 daddr_t	readdisklabel __P((char *, struct disklabel *));
Index: arch/bebox/stand/boot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/bebox/stand/boot/boot.c,v
retrieving revision 1.11
diff -u -r1.11 boot.c
--- boot.c	2000/07/29 20:06:28	1.11
+++ boot.c	2000/08/07 21:43:21
@@ -32,6 +32,7 @@
  */
 #include <stand.h>
 #include <loadfile.h>
+#include <sys/boot_flag.h>
 #include <sys/reboot.h>
 #include <machine/bootinfo.h>
 #include "boot.h"
@@ -170,16 +171,8 @@
 		if (!c)
 			goto next;
 		if (c == '-') {
-			while ((c = *++ptr) && c != ' ') {
-				if (c == 'a')
-					howto |= RB_ASKNAME;
-				else if (c == 'b')
-					howto |= RB_HALT;
-				else if (c == 'd')
-					howto |= RB_KDB;
-				else if (c == 's')
-					howto |= RB_SINGLE;
-			}
+			while ((c = *++ptr) && c != ' ')
+				howto |= boot_flag(c);
 		} else {
 			name = ptr;
 			while ((c = *++ptr) && c != ' ');
Index: arch/cobalt/cobalt/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/cobalt/cobalt/machdep.c,v
retrieving revision 1.20
diff -u -r1.20 machdep.c
--- machdep.c	2000/07/14 18:35:38	1.20
+++ machdep.c	2000/08/07 21:43:22
@@ -48,6 +48,7 @@
 #include <sys/mount.h>
 #include <sys/syscallargs.h>
 #include <sys/kcore.h>
+#include <sys/boot_flag.h>
 
 #include <machine/cpu.h>
 #include <machine/reg.h>
@@ -170,17 +171,7 @@
 			continue;
 		case '-':
 			while (bootstring[i] != ' ' && bootstring[i] != '\0') {
-				switch (bootstring[i]) {
-				case 'a':
-					boothowto |= RB_ASKNAME;
-					break;
-				case 'd':
-					boothowto |= RB_KDB;
-					break;
-				case 's':
-					boothowto |= RB_SINGLE;
-					break;
-				}
+				boothowto |= boot_flag(bootstring[i]);
 				i++;
 			}
 		}
Index: arch/hp300/stand/uboot/uboot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hp300/stand/uboot/uboot.c,v
retrieving revision 1.3
diff -u -r1.3 uboot.c
--- uboot.c	1997/04/27 21:17:13	1.3
+++ uboot.c	2000/08/07 21:43:22
@@ -37,6 +37,7 @@
 
 #include <sys/param.h>
 #include <sys/reboot.h>
+#include <sys/boot_flag.h>
 #include <a.out.h>
 
 #include <lib/libsa/stand.h>
@@ -107,7 +108,7 @@
 {
 	char c, *ptr = line;
 
-	printf("Boot: [[[%s%d%c:]%s][-s][-a][-d]] :- ",
+	printf("Boot: [[[%s%d%c:]%s][-s][-a][-d][-v][-q]] :- ",
 	    devsw[bdev].dv_name, bctlr + (8 * badapt), 'a' + bpart, name);
 
 	if (tgets(line)) {
@@ -123,20 +124,7 @@
 				return;
 			if (c == '-')
 				while ((c = *++ptr) && c != ' ')
-					switch (c) {
-					case 'a':
-						*howto |= RB_ASKNAME;
-						continue;
-					case 's':
-						*howto |= RB_SINGLE;
-						continue;
-					case 'd':
-						*howto |= RB_KDB;
-						continue;
-					case 'b':
-						*howto |= RB_HALT;
-						continue;
-					}
+					*howto |= boot_flag(c);
 			else {
 				name = ptr;
 				while ((c = *++ptr) && c != ' ');
Index: arch/hpcmips/hpcmips/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/hpcmips/machdep.c,v
retrieving revision 1.32
diff -u -r1.32 machdep.c
--- machdep.c	2000/07/29 20:06:28	1.32
+++ machdep.c	2000/08/07 21:43:23
@@ -71,6 +71,7 @@
 #include <sys/mount.h>
 #include <sys/syscallargs.h>
 #include <sys/kcore.h>
+#include <sys/boot_flag.h>
 
 #ifdef KGDB
 #include <sys/kgdb.h>
@@ -130,9 +131,7 @@
 /* Our exported CPU info; we can have only one. */  
 struct cpu_info cpu_info_store;
 
-/* verbose boot message */
-int	hpcmips_verbose = 0;
-#define VPRINTF(arg)	if (hpcmips_verbose) printf arg;
+#define VPRINTF(arg)	if (bootverbose) printf arg;
 
 /* maps for VM objects */
 vm_map_t exec_map = NULL;
@@ -321,22 +320,6 @@
 	for (i = 1; i < argc; i++) {
 		for (cp = argv[i]; *cp; cp++) {
 			switch (*cp) {
-			case 's': /* single-user */
-				boothowto |= RB_SINGLE;
-				break;
-
-			case 'd': /* break into the kernel debugger ASAP */
-				boothowto |= RB_KDB;
-				break;
-
-			case 'm': /* mini root present in memory */
-				boothowto |= RB_MINIROOT;
-				break;
-
-			case 'a': /* ask for names */
-				boothowto |= RB_ASKNAME;
-				break;
-
 			case 'h': /* XXX, serial console */
 				bootinfo->bi_cnuse |= BI_CNUSE_SERIAL;
 				break;
@@ -353,8 +336,8 @@
 #endif
 				cp += strlen(cp);
 				break;
-			case 'v': /* verbose for hpcmips */
-				hpcmips_verbose = 1;
+			default:
+				boothowto |= boot_flag(*cp);
 				break;
 			}
 		}
@@ -486,7 +469,7 @@
 	printf("%s\n", cpu_model);
 	format_bytes(pbuf, sizeof(pbuf), ctob(physmem));
 	printf("total memory = %s\n", pbuf);
-	if (hpcmips_verbose) {
+	if (bootverbose) {
 		/* show again when verbose mode */
 		printf("total memory banks = %d\n", mem_cluster_cnt);
 		for (i = 0; i < mem_cluster_cnt; i++) {
Index: arch/hpcmips/hpcmips/machdep.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/hpcmips/machdep.h,v
retrieving revision 1.4
diff -u -r1.4 machdep.h
--- machdep.h	2000/04/03 03:39:59	1.4
+++ machdep.h	2000/08/07 21:43:23
@@ -32,4 +32,3 @@
 
 /* others.. */
 extern char cpu_name[];
-extern int hpcmips_verbose;
Index: arch/hpcmips/isa/isa_machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/isa/isa_machdep.c,v
retrieving revision 1.6
diff -u -r1.6 isa_machdep.c
--- isa_machdep.c	2000/06/04 19:14:43	1.6
+++ isa_machdep.c	2000/08/07 21:43:24
@@ -53,11 +53,11 @@
 int vrisa_debug = VRISADEBUG_CONF;
 #define DPRINTF(arg) if (vrisa_debug) printf arg;
 #define DBITDISP32(mask) if (vrisa_debug) bitdisp32(mask);
-#define VPRINTF(arg) if (hpcmips_verbose || vrisa_debug) printf arg;
+#define VPRINTF(arg) if (bootverbose || vrisa_debug) printf arg;
 #else /* VRISADEBUG */
 #define DPRINTF(arg)
 #define DBITDISP32(mask)
-#define VPRINTF(arg) if (hpcmips_verbose) printf arg;
+#define VPRINTF(arg) if (bootverbose) printf arg;
 #endif /* VRISADEBUG */
 
 int	vrisabprint __P((void*, const char*));
Index: arch/hpcmips/vr/vrgiu.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/hpcmips/vr/vrgiu.c,v
retrieving revision 1.11
diff -u -r1.11 vrgiu.c
--- vrgiu.c	2000/07/20 03:44:52	1.11
+++ vrgiu.c	2000/08/07 21:43:24
@@ -43,7 +43,6 @@
 #include <mips/cpuregs.h>
 #include <machine/bus.h>
 
-#include <hpcmips/hpcmips/machdep.h>	/* hpcmips_verbose */
 #include <hpcmips/vr/vripreg.h>
 #include <hpcmips/vr/vripvar.h>
 #include <hpcmips/vr/vrgiureg.h>
@@ -63,19 +62,19 @@
 #define DDUMP_IOSETTING(flag, sc) \
 		if (vrgiu_debug & flag) vrgiu_dump_iosetting(sc);
 #define	VPRINTF(flag, arg) \
-		if (hpcmips_verbose || vrgiu_debug & flag) printf arg;
+		if (bootverbose || vrgiu_debug & flag) printf arg;
 #define VDUMP_IO(flag, sc) \
-		if (hpcmips_verbose || vrgiu_debug & flag) vrgiu_dump_io(sc);
+		if (bootverbose || vrgiu_debug & flag) vrgiu_dump_io(sc);
 #define VDUMP_IOSETTING(flag, sc) \
-		if (hpcmips_verbose || vrgiu_debug & flag) vrgiu_dump_iosetting(sc);
+		if (bootverbose || vrgiu_debug & flag) vrgiu_dump_iosetting(sc);
 #else
 #define	DPRINTF(flag, arg)
 #define DDUMP_IO(flag, sc)
 #define DDUMP_IOSETTING(flag, sc)
-#define	VPRINTF(flag, arg) if (hpcmips_verbose) printf arg;
-#define VDUMP_IO(flag, sc) if (hpcmips_verbose) vrgiu_dump_io(sc);
+#define	VPRINTF(flag, arg) if (bootverbose) printf arg;
+#define VDUMP_IO(flag, sc) if (bootverbose) vrgiu_dump_io(sc);
 #define VDUMP_IOSETTING(flag, sc) \
-			if (hpcmips_verbose) vrgiu_dump_iosetting(sc);
+			if (bootverbose) vrgiu_dump_iosetting(sc);
 #endif
 
 #define	LEGAL_INTR_PORT(x)	((x) >= 0 && (x) < MAX_GPIO_INOUT)
Index: arch/i386/stand/lib/libi386.h
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/stand/lib/libi386.h,v
retrieving revision 1.11
diff -u -r1.11 libi386.h
--- libi386.h	2000/04/23 19:57:14	1.11
+++ libi386.h	2000/08/07 21:43:26
@@ -89,7 +89,7 @@
 
 /* parseutils.c */
 char *gettrailer __P((char*));
-int parseopts __P((char*, int*));
+int parseopts __P((const char*, int*));
 int parseboot __P((char*, char**, int*));
 
 /* menuutils.c */
Index: arch/i386/stand/lib/parseutils.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/i386/stand/lib/parseutils.c,v
retrieving revision 1.1
diff -u -r1.1 parseutils.c
--- parseutils.c	1997/09/17 17:13:03	1.1
+++ parseutils.c	2000/08/07 21:43:26
@@ -39,6 +39,7 @@
 
 #include <lib/libkern/libkern.h>
 #include <lib/libsa/stand.h>
+#include <sys/boot_flag.h>
 
 #include "libi386.h"
 
@@ -66,14 +67,14 @@
 
 int
 parseopts(opts, howto)
-	char *opts;
+	const char *opts;
 	int *howto;
 {
 	int r, tmpopt = 0;
 
 	opts++; 	/* skip - */
 	while (*opts && *opts != ' ') {
-		r = netbsd_opt(*opts);
+		r = boot_flag(*opts);
 		if (r == -1) {
 			printf("-%c: unknown flag\n", *opts);
 			command_help(NULL);
@@ -103,7 +104,7 @@
 		return(1);
 
 	/* format is... */
-	/* [[xxNx:]filename] [-adrs] */
+	/* [[xxNx:]filename] [-adrsv] */
 
 	/* check for just args */
 	if (arg[0] == '-')
Index: arch/i386/stand/lib/netbsd_opts.c
===================================================================
RCS file: netbsd_opts.c
diff -N netbsd_opts.c
--- /tmp/cvs05088at	Tue Aug  8 00:43:58 2000
+++ /dev/null	Mon Aug  7 20:55:41 2000
@@ -1,69 +0,0 @@
-/*	$NetBSD: netbsd_opts.c,v 1.2 1997/03/14 06:55:07 thorpej Exp $	*/
-
-/*
- * Copyright (c) 1996
- * 	Matthias Drochner.  All rights reserved.
- * Copyright (c) 1996
- * 	Perry E. Metzger.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgements:
- *	This product includes software developed for the NetBSD Project
- *	by Matthias Drochner.
- *	This product includes software developed for the NetBSD Project
- *	by Perry E. Metzger.
- * 4. The names of the authors may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-
-#include <sys/reboot.h>
-
-#include <lib/libsa/stand.h>
-
-#include "libi386.h"
-
-static struct optent {
-	char name;
-	int flag;
-} opttab[] = {
-	{'a', RB_ASKNAME},
-	{'s', RB_SINGLE},
-	{'r', RB_DFLTROOT},
-	{'d', RB_KDB},
-};
-
-#define OPTTABSIZE (sizeof(opttab)/sizeof(struct optent))
-
-int
-netbsd_opt(c)
-	char c;
-{
-	int i;
-
-	for (i = 0; i < OPTTABSIZE; i++) {
-		if (c == opttab[i].name)
-			return (opttab[i].flag);
-	}
-	return (-1);
-}
Index: arch/luna68k/luna68k/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/luna68k/luna68k/machdep.c,v
retrieving revision 1.10
diff -u -r1.10 machdep.c
--- machdep.c	2000/06/29 08:17:26	1.10
+++ machdep.c	2000/08/07 21:43:28
@@ -68,6 +68,7 @@
 #ifdef	KGDB
 #include <sys/kgdb.h>
 #endif
+#include <sys/boot_flag.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -206,17 +207,7 @@
 	 * NetBSD/luna68k cares only the first argment; any of "sda".
 	 */
 	for (cp = bootarg; *cp != ' '; cp++) {
-		switch (*cp) {
-		case 's':
-			boothowto |= RB_SINGLE;
-			break;
-		case 'd':
-			boothowto |= RB_KDB;
-			break;
-		case 'a':
-			boothowto |= RB_ASKNAME;
-			break;
-		}
+		boothowto |= boot_flag(*cp);
 		if (i++ >= sizeof(bootarg))
 			break;
 	}
Index: arch/macppc/macppc/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/macppc/machdep.c,v
retrieving revision 1.82
diff -u -r1.82 machdep.c
--- machdep.c	2000/07/25 05:44:27	1.82
+++ machdep.c	2000/08/07 21:43:29
@@ -52,6 +52,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/user.h>
+#include <sys/boot_flag.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -306,20 +307,8 @@
 	args = bootpath;
 	while (*++args && *args != ' ');
 	if (*args) {
-		*args++ = 0;
-		while (*args) {
-			switch (*args++) {
-			case 'a':
-				boothowto |= RB_ASKNAME;
-				break;
-			case 's':
-				boothowto |= RB_SINGLE;
-				break;
-			case 'd':
-				boothowto |= RB_KDB;
-				break;
-			}
-		}
+		for(*args++ = 0; *args; args++)
+			boothowto |= boot_flag(*args++);
 	}
 
 #ifdef DDB
Index: arch/macppc/stand/ofwboot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/macppc/stand/ofwboot/boot.c,v
retrieving revision 1.8
diff -u -r1.8 boot.c
--- boot.c	2000/07/25 06:26:19	1.8
+++ boot.c	2000/08/07 21:43:30
@@ -84,6 +84,7 @@
 #include <sys/exec_elf.h>
 #include <sys/reboot.h>
 #include <sys/disklabel.h>
+#include <sys/boot_flag.h>
 
 #include <lib/libsa/stand.h>
 #include <lib/libsa/loadfile.h>
@@ -147,20 +148,8 @@
 
 found:
 	*cp++ = 0;
-	while (*cp) {
-		switch (*cp++) {
-		case 'a':
-			*howtop |= RB_ASKNAME;
-			break;
-		case 's':
-			*howtop |= RB_SINGLE;
-			break;
-		case 'd':
-			*howtop |= RB_KDB;
-			debug = 1;
-			break;
-		}
-	}
+	while (*cp)
+		*howtop |= boot_flag(*cp++);
 }
 
 static void
Index: arch/mvme68k/stand/libsa/parse_args.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/mvme68k/stand/libsa/parse_args.c,v
retrieving revision 1.6
diff -u -r1.6 parse_args.c
--- parse_args.c	2000/07/29 20:06:30	1.6
+++ parse_args.c	2000/08/07 21:43:30
@@ -36,24 +36,13 @@
 #include <sys/reboot.h>
 #include <sys/disklabel.h>
 #include <machine/prom.h>
+#include <sys/boot_flag.h>
 
 #include "stand.h"
 #include "libsa.h"
 
 #define KERNEL_NAME "netbsd"
 
-struct flags {
-	char c;
-	short bit;
-} bf[] = {
-	{ 'a', RB_ASKNAME },
-	{ 'b', RB_HALT },
-	{ 'y', RB_NOSYM },
-	{ 'd', RB_KDB },
-	{ 'm', RB_MINIROOT },
-	{ 's', RB_SINGLE },
-};
-
 void
 parse_args(filep, flagp, partp)
 char **filep;
@@ -90,13 +79,9 @@
 				if (c)
 					*ptr++ = 0;
 				continue;
-			}
-			while ((c = *++ptr) && c != ' ') {
-				for (i = 0; i < sizeof(bf)/sizeof(bf[0]); i++)
-					if (bf[i].c == c) {
-						howto |= bf[i].bit;
-					}
 			}
+			while ((c = *++ptr) && c != ' ')
+				howto |= boot_flag(c);
 		}
 	}
 	*flagp = howto;
Index: arch/next68k/next68k/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/next68k/next68k/machdep.c,v
retrieving revision 1.37
diff -u -r1.37 machdep.c
--- machdep.c	2000/06/29 07:58:50	1.37
+++ machdep.c	2000/08/07 21:43:32
@@ -73,6 +73,7 @@
 #ifdef KGDB
 #include <sys/kgdb.h>
 #endif
+#include <sys/boot_flag.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -198,21 +199,8 @@
 		char *p = rom_boot_arg;
 		boothowto = 0;
 		if (*p++ == '-') {
-			for (;*p;p++) {
-				switch(*p) {
-				case 'a':
-					boothowto |= RB_ASKNAME;
-					break;
-				case 's':
-					boothowto |= RB_SINGLE;
-					break;
-				case 'd':
-					boothowto |= RB_KDB;
-					break;
-				default:
-					break;
-				}
-			}
+			for (;*p;p++)
+				boothowto |= boot_flag(*p);
 		}
 	}
 
Index: arch/ofppc/ofppc/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/ofppc/ofppc/machdep.c,v
retrieving revision 1.57
diff -u -r1.57 machdep.c
--- machdep.c	2000/07/02 04:40:42	1.57
+++ machdep.c	2000/08/07 21:43:33
@@ -49,6 +49,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/user.h>
+#include <sys/boot_flag.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -245,20 +246,8 @@
 	bootpath = args;
 	while (*++args && *args != ' ');
 	if (*args) {
-		*args++ = 0;
-		while (*args) {
-			switch (*args++) {
-			case 'a':
-				boothowto |= RB_ASKNAME;
-				break;
-			case 's':
-				boothowto |= RB_SINGLE;
-				break;
-			case 'd':
-				boothowto |= RB_KDB;
-				break;
-			}
-		}
+		for(*args++ = 0; *args; args++)
+			boothowto |= boot_flag(*args);
 	}
 
 #ifdef DDB
Index: arch/ofppc/stand/ofwboot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/ofppc/stand/ofwboot/boot.c,v
retrieving revision 1.6
diff -u -r1.6 boot.c
--- boot.c	1999/10/25 14:01:29	1.6
+++ boot.c	2000/08/07 21:43:34
@@ -84,6 +84,7 @@
 #include <sys/exec_elf.h>
 #include <sys/reboot.h>
 #include <sys/disklabel.h>
+#include <sys/boot_flag.h>
 
 #include <lib/libsa/stand.h>
 #include <lib/libkern/libkern.h>
@@ -138,21 +139,9 @@
 	if (!*cp)
 		return;
 	
-	*cp++ = 0;
-	while (*cp) {
-		switch (*cp++) {
-		case 'a':
-			*howtop |= RB_ASKNAME;
-			break;
-		case 's':
-			*howtop |= RB_SINGLE;
-			break;
-		case 'd':
-			*howtop |= RB_KDB;
-			debug = 1;
-			break;
-		}
-	}
+	*cp++ = '\0';
+	while (*cp)
+		*howtop |= boot_flag(*cp++);
 }
 
 static void
Index: arch/pc532/stand/boot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/pc532/stand/boot/boot.c,v
retrieving revision 1.2
diff -u -r1.2 boot.c
--- boot.c	2000/07/29 20:06:29	1.2
+++ boot.c	2000/08/07 21:43:34
@@ -37,6 +37,7 @@
 
 #include <sys/param.h>
 #include <sys/reboot.h>
+#include <sys/boot_flag.h>
 
 #include <lib/libsa/stand.h>
 
@@ -118,20 +119,7 @@
 				return;
 			if (c == '-')
 				while ((c = *++ptr) && c != ' ')
-					switch (c) {
-					case 'a':
-						*howto |= RB_ASKNAME;
-						continue;
-					case 'b':
-						*howto |= RB_HALT;
-						continue;
-					case 'd':
-						*howto |= RB_KDB;
-						continue;
-					case 's':
-						*howto |= RB_SINGLE;
-						continue;
-					}
+					*howto |= boot_flag(c);
 			else {
 				name = ptr;
 				while ((c = *++ptr) && c != ' ');
Index: arch/pmax/pmax/machdep.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/pmax/pmax/machdep.c,v
retrieving revision 1.178
diff -u -r1.178 machdep.c
--- machdep.c	2000/07/29 20:06:29	1.178
+++ machdep.c	2000/08/07 21:43:37
@@ -56,6 +56,7 @@
 #include <sys/user.h>
 #include <sys/mount.h>
 #include <sys/kcore.h>
+#include <sys/boot_flag.h>
 
 #include <uvm/uvm_extern.h>
 
@@ -267,20 +268,17 @@
 				boothowto &= ~RB_SINGLE;
 				break;
 
-			case 'd': /* break into the kernel debugger ASAP */
-				boothowto |= RB_KDB;
-				break;
-
-			case 'm': /* mini root present in memory */
-				boothowto |= RB_MINIROOT;
-				break;
-
 			case 'n': /* ask for names */
 				boothowto |= RB_ASKNAME;
 				break;
 
 			case 'N': /* don't ask for names */
 				boothowto &= ~RB_ASKNAME;
+				break;
+
+			default:
+				boothowto |= boot_flag(*cp);
+				break;
 			}
 		}
 	}
Index: arch/prep/stand/boot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/prep/stand/boot/boot.c,v
retrieving revision 1.2
diff -u -r1.2 boot.c
--- boot.c	2000/07/29 20:06:29	1.2
+++ boot.c	2000/08/07 21:43:37
@@ -34,6 +34,7 @@
 #include <lib/libsa/stand.h>
 #include <lib/libsa/loadfile.h>
 #include <sys/reboot.h>
+#include <sys/boot_flag.h>
 #include <machine/bootinfo.h>
 #include <machine/cpu.h>
 #include <machine/residual.h>
@@ -178,16 +179,8 @@
 		if (!c)
 			goto next;
 		if (c == '-') {
-			while ((c = *++ptr) && c != ' ') {
-				if (c == 'a')
-					howto |= RB_ASKNAME;
-				else if (c == 'b')
-					howto |= RB_HALT;
-				else if (c == 'd')
-					howto |= RB_KDB;
-				else if (c == 's')
-					howto |= RB_SINGLE;
-			}
+			while ((c = *++ptr) && c != ' ')
+				howto |= boot_flag(c);
 		} else {
 			name = ptr;
 			while ((c = *++ptr) && c != ' ');
Index: arch/sparc/sparc/autoconf.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc/sparc/autoconf.c,v
retrieving revision 1.141
diff -u -r1.141 autoconf.c
--- autoconf.c	2000/07/29 20:06:29	1.141
+++ autoconf.c	2000/08/07 21:43:40
@@ -64,6 +64,7 @@
 #include <sys/queue.h>
 #include <sys/msgbuf.h>
 #include <sys/user.h>
+#include <sys/boot_flag.h>
 
 #include <net/if.h>
 
@@ -348,6 +349,7 @@
 {
 	char *cp, *pp;
 	struct bootpath *bp;
+	int fl;
 
 	/*
 	 * Grab boot path from PROM and split into `bootpath' components.
@@ -404,19 +406,17 @@
 		if (*cp++ == '\0')
 			return;
 
-	for (;;) {
-		switch (*++cp) {
-
-		case '\0':
-			return;
-
-		case 'a':
-			boothowto |= RB_ASKNAME;
-			break;
+	for (;*++cp;) {
+		fl = boot_flag(*cp);
+		if (!fl) {
+			printf("unknown option `%c'\n", *cp);
+			continue;
+		}
+		boothowto |= fl;
 
-		case 'd':	/* kgdb - always on zs	XXX */
+		/* specialties */
+		if (*cp == 'd') {
 #if defined(KGDB)
-			boothowto |= RB_KDB;	/* XXX unused */
 			kgdb_debug_panic = 1;
 			kgdb_connect(1);
 #elif defined(DDB)
@@ -424,14 +424,6 @@
 #else
 			printf("kernel has no debugger\n");
 #endif
-			break;
-
-		case 's':
-			boothowto |= RB_SINGLE;
-			break;
-
-		default:
-			printf("unknown option `%c'\n", *cp);
 		}
 	}
 }
Index: arch/sparc64/sparc64/autoconf.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/sparc64/autoconf.c,v
retrieving revision 1.38
diff -u -r1.38 autoconf.c
--- autoconf.c	2000/07/29 20:06:29	1.38
+++ autoconf.c	2000/08/07 21:43:43
@@ -63,6 +63,7 @@
 #include <sys/malloc.h>
 #include <sys/queue.h>
 #include <sys/msgbuf.h>
+#include <sys/boot_flag.h>
 
 #include <net/if.h>
 
@@ -319,19 +320,17 @@
 		if (*cp++ == '\0')
 			return;
 
-	for (;;) {
-		switch (*++cp) {
-
-		case '\0':
-			return;
-
-		case 'a':
-			boothowto |= RB_ASKNAME;
-			break;
+	for (;*++cp;) {
+		fl = boot_flag(*cp);
+		if (!fl) {
+			printf("unknown option `%c'\n", *cp);
+			continue;
+		}
+		boothowto |= fl;
 
-		case 'd':	/* kgdb - always on zs	XXX */
+		/* specialties */
+		if (*cp == 'd') {
 #if defined(KGDB)
-			boothowto |= RB_KDB;	/* XXX unused */
 			kgdb_debug_panic = 1;
 			kgdb_connect(1);
 #elif defined(DDB)
@@ -339,20 +338,11 @@
 #else
 			printf("kernel has no debugger\n");
 #endif
-			break;
-
-		case 's':
-			boothowto |= RB_SINGLE;
-			break;
-
-		case 't':
-		{
+		} else if (*cp == 't') {
 			/* turn on traptrace w/o breaking into kdb */
 			extern int trap_trace_dis;
 
 			trap_trace_dis = 0;
-			break;
-		}
 		}
 	}
 }
Index: arch/sparc64/stand/ofwboot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sparc64/stand/ofwboot/boot.c,v
retrieving revision 1.14
diff -u -r1.14 boot.c
--- boot.c	2000/06/08 22:58:42	1.14
+++ boot.c	2000/08/07 21:43:44
@@ -55,6 +55,7 @@
 #include <sys/exec_elf.h>
 #include <sys/reboot.h>
 #include <sys/disklabel.h>
+#include <sys/boot_flag.h>
 
 #include <machine/cpu.h>
 
@@ -149,22 +150,16 @@
 	
 	*cp++ = 0;
 	while (*cp) {
+		*howtop |= boot_flag(*cp);
+		/* handle specialties */
 		switch (*cp++) {
-		case 'a':
-			*howtop |= RB_ASKNAME;
-			break;
-		case 's':
-			*howtop |= RB_SINGLE;
-			break;
 		case 'd':
-			*howtop |= RB_KDB;
 			if (!debug) debug = 1;
 			break;
 		case 'D':
 			debug = 2;
 			break;
-		case 'v':
-			if (!debug) debug = 1;
+		default:
 			break;
 		}
 	}
Index: arch/sun3/sun3/sunmon.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/sun3/sun3/sunmon.c,v
retrieving revision 1.9
diff -u -r1.9 sunmon.c
--- sunmon.c	1998/02/26 19:30:59	1.9
+++ sunmon.c	2000/08/07 21:43:44
@@ -39,6 +39,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/reboot.h>
+#include <sys/boot_flag.h>
 
 #include <machine/mon.h>
 
@@ -279,19 +280,8 @@
 #ifdef	DEBUG
 		mon_printf("boot option: %s\n", p);
 #endif
-		for (++p; *p; p++) {
-			switch (*p) {
-			case 'a':
-				boothowto |= RB_ASKNAME;
-				break;
-			case 's':
-				boothowto |= RB_SINGLE;
-				break;
-			case 'd':
-				boothowto |= RB_KDB;
-				break;
-			}
-		}
+		for (++p; *p; p++)
+			boothowto |= boot_flag(*p);
 		argp++;
 	}
 
Index: arch/vax/boot/boot/boot.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/vax/boot/boot/boot.c,v
retrieving revision 1.12
diff -u -r1.12 boot.c
--- boot.c	2000/07/19 02:39:11	1.12
+++ boot.c	2000/08/07 21:43:45
@@ -34,8 +34,9 @@
  *	@(#)boot.c	7.15 (Berkeley) 5/4/91
  */
 
-#include "sys/param.h"
-#include "sys/reboot.h"
+#include <sys/param.h>
+#include <sys/reboot.h>
+#include <sys/boot_flag.h>
 #include "lib/libsa/stand.h"
 #include "lib/libsa/loadfile.h"
 #include "lib/libkern/libkern.h"
@@ -196,6 +197,7 @@
 boot(char *arg)
 {
 	char *fn = "netbsd";
+	int howto, fl;
 
 	if (arg) {
 		while (*arg == ' ')
@@ -211,20 +213,18 @@
 				goto load;
 		}
 		if (*arg != '-') {
-fail:			printf("usage: boot [filename] [-asd]\n");
+fail:			printf("usage: boot [filename] [-asdv]\n");
 			return;
 		}
 
+		howto = 0;
 		while (*++arg) {
-			if (*arg == 'a')
-				bootrpb.rpb_bootr5 |= RB_ASKNAME;
-			else if (*arg == 'd')
-				bootrpb.rpb_bootr5 |= RB_KDB;
-			else if (*arg == 's')
-				bootrpb.rpb_bootr5 |= RB_SINGLE;
-			else
+			fl = boot_flag(*arg);
+			if (!fl)
 				goto fail;
+			howto |= fl;
 		}
+		bootrpb.rpb_bootr5 = howto;
 	}
 load:	exec(fn, 0, 0);
 	printf("Boot failed: %s\n", strerror(errno));
Index: arch/x68k/stand/loadbsd/loadbsd.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/x68k/stand/loadbsd/loadbsd.c,v
retrieving revision 1.5
diff -u -r1.5 loadbsd.c
--- loadbsd.c	2000/07/29 20:06:30	1.5
+++ loadbsd.c	2000/08/07 21:43:46
@@ -8,7 +8,6 @@
  *
  *	loadbsd options:
  *		-h	help
- *		-v	verbose
  *		-V	print version and exit
  *
  *	kernel options:
@@ -17,6 +16,8 @@
  *		-D	enter kernel debugger
  *		-b	ask root device
  *		-r	specify root device
+ *		-q	quiet boot
+ *		-v	verbose boot (also turn on verbosity of loadbsd)
  *
  *	$NetBSD: loadbsd.c,v 1.5 2000/07/29 20:06:30 jdolecek Exp $
  */
@@ -492,6 +493,7 @@
 				break;
 			case 'v':
 				opt_v = 1;
+				boothowto |= AB_VERBOSE; /* XXX */
 				break;
 			case 'V':
 				xprintf("loadbsd %s\n", VERSION);
@@ -519,6 +521,9 @@
 				break;
 			case 'D':
 				boothowto |= RB_KDB;
+				break;
+			case 'q':
+				boothowto |= AB_QUIET;
 				break;
 
 			default:
Index: dev/ic/aic7xxx_seeprom.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/aic7xxx_seeprom.c,v
retrieving revision 1.3
diff -u -r1.3 aic7xxx_seeprom.c
--- aic7xxx_seeprom.c	2000/06/06 17:29:40	1.3
+++ aic7xxx_seeprom.c	2000/08/07 21:43:47
@@ -45,6 +45,7 @@
 #include <sys/kernel.h>
 #include <sys/queue.h>
 #include <sys/device.h>
+#include <sys/reboot.h>		/* for AB_* needed by bootverbose */
 
 #include <machine/bus.h>
 #include <machine/intr.h>
@@ -56,12 +57,6 @@
 #include <dev/microcode/aic7xxx/aic7xxx_reg.h>
 #include <dev/ic/aic7xxxvar.h>
 #include <dev/ic/smc93cx6var.h>
-
-#ifdef DEBUG
-#define bootverbose 1
-#else
-#define bootverbose 0
-#endif
 
 static void configure_termination(struct ahc_softc *,
 				  struct seeprom_descriptor *, u_int, u_int *);
Index: dev/pci/ahc_pci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/pci/ahc_pci.c,v
retrieving revision 1.24
diff -u -r1.24 ahc_pci.c
--- ahc_pci.c	2000/05/10 17:07:52	1.24
+++ ahc_pci.c	2000/08/07 21:43:55
@@ -41,6 +41,7 @@
 #include <sys/kernel.h>
 #include <sys/queue.h>
 #include <sys/device.h>
+#include <sys/reboot.h>
 
 #include <machine/bus.h>
 #include <machine/intr.h>
@@ -64,12 +65,6 @@
 #include <dev/ic/smc93cx6var.h>
 
 #include <dev/microcode/aic7xxx/aic7xxx_reg.h>
-
-#ifdef DEBUG
-#define bootverbose 1
-#else
-#define bootverbose 1
-#endif
 
 struct ahc_pci_busdata {
 	pci_chipset_tag_t pc;

--ELM965688240-13228-0_--