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
This commit is contained in:
Pierre Beyssac 2002-03-23 19:40:27 +00:00
parent 7ee69ef245
commit 038148d678
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93044
3 changed files with 21 additions and 5 deletions

View file

@ -71,7 +71,9 @@ However, it is possible to dispense with the third stage altogether,
either by specifying a kernel name in the boot block parameter
file,
.Pa /boot.config ,
or by hitting a key during a brief pause (while one of the characters
or, unless option
.Fl n
is set, by hitting a key during a brief pause (while one of the characters
.Sy - ,
.Sy \e ,
.Sy \&| ,
@ -230,6 +232,8 @@ option described here. See the man page for
for more details.
.It Fl m
mute the console.
.It Fl n
ignore key press to interrupt boot before loader(8) is invoked.
.It Fl P
probe the keyboard. If no keyboard is found, the
.Fl D

View file

@ -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);

View file

@ -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);