summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorgvf <gvf@cvs.openbsd.org>1997-04-17 19:16:43 +0000
committergvf <gvf@cvs.openbsd.org>1997-04-17 19:16:43 +0000
commit09e787efd3a90f2c8404b024e8506534d0435733 (patch)
tree63c06f126b3d013e6a278af00bc8b1702af0d6f3 /sys/arch
parente8c24a34e8d5b58a56602041fd2fc405757d77c8 (diff)
Added -q to return to Motorola bug.
Added loop to prompt for kernel name if it is not found.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvme68k/stand/bootsd/boot.c30
-rw-r--r--sys/arch/mvme68k/stand/libsa/libsa.h2
-rw-r--r--sys/arch/mvme68k/stand/libsa/parse_args.c7
3 files changed, 31 insertions, 8 deletions
diff --git a/sys/arch/mvme68k/stand/bootsd/boot.c b/sys/arch/mvme68k/stand/bootsd/boot.c
index 646dcb1d547..1fcc0bdf2e6 100644
--- a/sys/arch/mvme68k/stand/bootsd/boot.c
+++ b/sys/arch/mvme68k/stand/bootsd/boot.c
@@ -46,19 +46,39 @@
int debug;
int errno;
extern char *version;
+char line[80];
int
main()
{
char *cp, *file;
- int io, flag;
+ int io, flag, ret;
+ int ask = 0;
printf(">> OpenBSD MVME%x bootsd [%s]\n", bugargs.cputyp, version);
- parse_args(&file, &flag);
+ ret = parse_args(&file, &flag);
- exec_mvme(file, flag);
-
- printf("boot: %s: %s\n", file, strerror(errno));
+ for (;;) {
+ if (ask) {
+ printf("boot: ");
+ gets(line);
+ if (line[0]) {
+ bugargs.arg_start = line;
+ cp = line;
+ while (cp < (line + sizeof(line) -1) && *cp)
+ cp++;
+ bugargs.arg_end = cp;
+ ret = parse_args(&file, &flag);
+ }
+ }
+ if ( ret == -1 ) {
+ printf("boot: -q returning to MVME-Bug\n");
+ break;
+ }
+ exec_mvme(file, flag);
+ printf("boot: %s: %s\n", file, strerror(errno));
+ ask = 1;
+ }
return(0);
}
diff --git a/sys/arch/mvme68k/stand/libsa/libsa.h b/sys/arch/mvme68k/stand/libsa/libsa.h
index 3657bc00636..eff5fd7988e 100644
--- a/sys/arch/mvme68k/stand/libsa/libsa.h
+++ b/sys/arch/mvme68k/stand/libsa/libsa.h
@@ -14,5 +14,5 @@ int bugscstrategy __P((void *, int, daddr_t, size_t, void *, size_t *));
void exec_mvme __P((char *, int));
/* parse_args.c */
-void parse_args __P((char **, int *));
+int parse_args __P((char **, int *));
diff --git a/sys/arch/mvme68k/stand/libsa/parse_args.c b/sys/arch/mvme68k/stand/libsa/parse_args.c
index 2cdc474c360..25cecfcd533 100644
--- a/sys/arch/mvme68k/stand/libsa/parse_args.c
+++ b/sys/arch/mvme68k/stand/libsa/parse_args.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse_args.c,v 1.2 1996/07/27 11:28:15 deraadt Exp $ */
+/* $OpenBSD: parse_args.c,v 1.3 1997/04/17 19:16:42 gvf Exp $ */
/*-
* Copyright (c) 1995 Theo de Raadt
@@ -56,7 +56,7 @@ struct flags {
{ 's', RB_SINGLE },
};
-void
+int
parse_args(filep, flagp)
char **filep;
@@ -83,6 +83,8 @@ int *flagp;
continue;
}
while ((c = *++ptr) && c != ' ') {
+ if (c == 'q')
+ return (-1);
for (i = 0; i < sizeof(bf)/sizeof(bf[0]); i++)
if (bf[i].c == c) {
howto |= bf[i].bit;
@@ -92,4 +94,5 @@ int *flagp;
}
*flagp = howto;
*filep = name;
+ return (0);
}