diff options
author | pb <pb@FreeBSD.org> | 2002-03-23 19:40:27 +0000 |
---|---|---|
committer | pb <pb@FreeBSD.org> | 2002-03-23 19:40:27 +0000 |
commit | 67873bb7a8246bf8d6726b0912d5d7de275e340a (patch) | |
tree | c9d0105aabd65927d1318e427e7dd555e6b81916 /sys/boot/i386 | |
parent | 96f89601bec8d2572d482a8d78c1b5f67932a00b (diff) | |
download | FreeBSD-src-67873bb7a8246bf8d6726b0912d5d7de275e340a.zip FreeBSD-src-67873bb7a8246bf8d6726b0912d5d7de275e340a.tar.gz |
Add option -n to i386 boot2 to disallow boot interruption by keypress.
PR: i386/36016
Submitted by: Thomas Quinot <thomas@cuivre.fr.eu.org>
Reviewed by: rnordier
MFC after: 1 week
Diffstat (limited to 'sys/boot/i386')
-rw-r--r-- | sys/boot/i386/boot2/boot2.c | 10 | ||||
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 520753d..955c592 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -50,6 +50,7 @@ #define RBX_PAUSE 0x12 /* -p */ #define RBX_DUAL 0x1d /* -D */ #define RBX_PROBEKBD 0x1e /* -P */ +#define RBX_NOINTR 0x1f /* -n */ #define RBX_MASK 0x2005ffff @@ -58,7 +59,7 @@ #define PATH_KERNEL "/kernel" #define ARGS 0x900 -#define NOPT 13 +#define NOPT 14 #define NDEV 5 #define MEM_BASE 0x12 #define MEM_EXT 0x15 @@ -100,7 +101,7 @@ static struct dmadat { extern uint32_t _end; -static const char optstr[NOPT] = "DhaCcdgmPprsv"; +static const char optstr[NOPT] = "DhaCcdgmnPprsv"; static const unsigned char flags[NOPT] = { RBX_DUAL, RBX_SERIAL, @@ -110,6 +111,7 @@ static const unsigned char flags[NOPT] = { RBX_KDB, RBX_GDB, RBX_MUTE, + RBX_NOINTR, RBX_PROBEKBD, RBX_PAUSE, RBX_DFLTROOT, @@ -775,6 +777,8 @@ keyhit(unsigned ticks) { uint32_t t0, t1; + if (opts & 1 << RBX_NOINTR) + return 0; t0 = 0; for (;;) { if (xgetc(1)) @@ -800,6 +804,8 @@ xputc(int c) static int xgetc(int fn) { + if (opts & 1 << RBX_NOINTR) + return 0; for (;;) { if (ioctrl & 0x1 && getc(1)) return fn ? 1 : getc(0); diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 520753d..955c592 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -50,6 +50,7 @@ #define RBX_PAUSE 0x12 /* -p */ #define RBX_DUAL 0x1d /* -D */ #define RBX_PROBEKBD 0x1e /* -P */ +#define RBX_NOINTR 0x1f /* -n */ #define RBX_MASK 0x2005ffff @@ -58,7 +59,7 @@ #define PATH_KERNEL "/kernel" #define ARGS 0x900 -#define NOPT 13 +#define NOPT 14 #define NDEV 5 #define MEM_BASE 0x12 #define MEM_EXT 0x15 @@ -100,7 +101,7 @@ static struct dmadat { extern uint32_t _end; -static const char optstr[NOPT] = "DhaCcdgmPprsv"; +static const char optstr[NOPT] = "DhaCcdgmnPprsv"; static const unsigned char flags[NOPT] = { RBX_DUAL, RBX_SERIAL, @@ -110,6 +111,7 @@ static const unsigned char flags[NOPT] = { RBX_KDB, RBX_GDB, RBX_MUTE, + RBX_NOINTR, RBX_PROBEKBD, RBX_PAUSE, RBX_DFLTROOT, @@ -775,6 +777,8 @@ keyhit(unsigned ticks) { uint32_t t0, t1; + if (opts & 1 << RBX_NOINTR) + return 0; t0 = 0; for (;;) { if (xgetc(1)) @@ -800,6 +804,8 @@ xputc(int c) static int xgetc(int fn) { + if (opts & 1 << RBX_NOINTR) + return 0; for (;;) { if (ioctrl & 0x1 && getc(1)) return fn ? 1 : getc(0); |