Add new boot flag to i386 boot: -p.

This flag adds a pausing utility. When ran with -p, during the kernel
probing phase, the kernel will pause after each line of output.
This pausing can be ended with the '.' key, and is automatically
suspended when entering ddb.

This flag comes in handy at systems without a serial port that either hang
during booting or reser.
Reviewed by:	(partly by jlemon)
MFC after:	1 week
This commit is contained in:
Guido van Rooij 2001-12-10 20:02:22 +00:00
parent 3809d6a1b9
commit 28703190c5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87620
9 changed files with 39 additions and 2 deletions

View File

@ -223,6 +223,8 @@ probe the keyboard. If no keyboard is found, the
and
.Fl h
options are automatically set.
.It Fl p
pause after each attached device during the device probing phase.
.It Fl r
use the statically configured default for the device containing the
root file system

View File

@ -176,7 +176,7 @@ configure_final(dummy)
{
int i;
/* cninit_finish(); */
cninit_finish();
if (bootverbose) {

View File

@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
case 'h':
howto |= RB_SERIAL;
break;
case 'p':
howto |= RB_PAUSE;
break;
case 'r':
howto |= RB_DFLTROOT;
break;

View File

@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
case 'h':
howto |= RB_SERIAL;
break;
case 'p':
howto |= RB_PAUSE;
break;
case 'r':
howto |= RB_DFLTROOT;
break;

View File

@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
case 'h':
howto |= RB_SERIAL;
break;
case 'p':
howto |= RB_PAUSE;
break;
case 'r':
howto |= RB_DFLTROOT;
break;

View File

@ -176,7 +176,7 @@ configure_final(dummy)
{
int i;
/* cninit_finish(); */
cninit_finish();
if (bootverbose) {

View File

@ -55,6 +55,8 @@
#include <sys/uio.h>
#include <sys/vnode.h>
#include <ddb/ddb.h>
#include <machine/cpu.h>
static d_open_t cnopen;
@ -112,6 +114,9 @@ static int cn_mute;
static int openflag; /* how /dev/console was opened */
static int cn_is_open;
static dev_t cn_devfsdev; /* represents the device private info */
static u_char console_pausing; /* pause after each line during probe */
static char *console_pausestr=
"<pause; press any key to proceed to next line or '.' to end pause mode>";
void cndebug(char *);
@ -162,12 +167,20 @@ cninit(void)
cnadd(best_cn);
best_cn->cn_init(best_cn);
}
if (boothowto & RB_PAUSE)
console_pausing = 1;
/*
* Make the best console the preferred console.
*/
cnselect(best_cn);
}
void
cninit_finish()
{
console_pausing = 0;
}
/* add a new physical console to back the virtual console */
int
cnadd(struct consdev *cn)
@ -526,6 +539,7 @@ cnputc(int c)
{
struct cn_device *cnd;
struct consdev *cn;
char *cp;
if (cn_mute || c == '\0')
return;
@ -535,6 +549,16 @@ cnputc(int c)
cn->cn_putc(cn->cn_dev, '\r');
cn->cn_putc(cn->cn_dev, c);
}
if (console_pausing && !db_active && (c == '\n')) {
for (cp = console_pausestr; *cp != '\0'; cp++)
cnputc(*cp);
if (cngetc() == '.')
console_pausing = 0;
cnputc('\r');
for (cp = console_pausestr; *cp != '\0'; cp++)
cnputc(' ');
cnputc('\r');
}
}
void

View File

@ -88,6 +88,7 @@ extern int cons_unavail;
/* Other kernel entry points. */
void cninit(void);
void cninit_finish(void);
int cnadd(struct consdev *);
void cnremove(struct consdev *);
void cnselect(struct consdev *);

View File

@ -61,6 +61,7 @@
#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
#define RB_MUTE 0x10000 /* Come up with the console muted */
#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
#define RB_PAUSE 0x40000 /* pause after each output line during probe */
#define RB_MULTIPLE 0x20000000 /* Use multiple consoles */
#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */