From 93d51dcaf9f2199b3bf43ecf4e025a0aaafc71d2 Mon Sep 17 00:00:00 2001 From: Robert Nordier Date: Sat, 17 Oct 1998 09:50:09 +0000 Subject: [PATCH] Treat all options as toggles (ie. -c -c is the same no -c). Since the boot.config settings are persistent, this seems to provide a useful override capability, and should break only on broken boot.config's. Output a cosmetic newline if booting with no input. --- sys/boot/i386/boot2/boot2.c | 10 ++++------ sys/boot/i386/gptboot/gptboot.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 8c494c047c0..f24e19f1966 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -14,7 +14,7 @@ */ /* - * $Id: boot2.c,v 1.8 1998/10/17 09:01:13 rnordier Exp $ + * $Id: boot2.c,v 1.9 1998/10/17 09:16:01 rnordier Exp $ */ #include @@ -57,7 +57,6 @@ #define ARGS 0x800 #define NOPT 11 -#define XOPT 2 #define BSIZEMAX 8192 #define NDEV 5 #define MEM_BASE 0x12 @@ -184,6 +183,8 @@ main(void) sio_flush(); if (!autoboot || keyhit(0x5a)) getstr(cmd, sizeof(cmd)); + else + putchar('\n'); autoboot = helpon = 0; if (parse(cmd)) helpon = 1; @@ -320,10 +321,7 @@ parse(char *arg) for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; - if (i < XOPT) - opts ^= 1 << flags[i]; - else - opts |= 1 << flags[i]; + opts ^= 1 << flags[i]; } if (opts & 1 << RBX_PROBEKBD) { i = *(uint8_t *)PTOV(0x496) & 0x10; diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 8c494c047c0..f24e19f1966 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -14,7 +14,7 @@ */ /* - * $Id: boot2.c,v 1.8 1998/10/17 09:01:13 rnordier Exp $ + * $Id: boot2.c,v 1.9 1998/10/17 09:16:01 rnordier Exp $ */ #include @@ -57,7 +57,6 @@ #define ARGS 0x800 #define NOPT 11 -#define XOPT 2 #define BSIZEMAX 8192 #define NDEV 5 #define MEM_BASE 0x12 @@ -184,6 +183,8 @@ main(void) sio_flush(); if (!autoboot || keyhit(0x5a)) getstr(cmd, sizeof(cmd)); + else + putchar('\n'); autoboot = helpon = 0; if (parse(cmd)) helpon = 1; @@ -320,10 +321,7 @@ parse(char *arg) for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; - if (i < XOPT) - opts ^= 1 << flags[i]; - else - opts |= 1 << flags[i]; + opts ^= 1 << flags[i]; } if (opts & 1 << RBX_PROBEKBD) { i = *(uint8_t *)PTOV(0x496) & 0x10;