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);
}
void exec_mvme __P((char *, int));
/* parse_args.c */
-void parse_args __P((char **, int *));
+int parse_args __P((char **, int *));
-/* $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
{ 's', RB_SINGLE },
};
-void
+int
parse_args(filep, flagp)
char **filep;
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;
}
*flagp = howto;
*filep = name;
+ return (0);
}