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:
parent
3809d6a1b9
commit
28703190c5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87620
@ -223,6 +223,8 @@ probe the keyboard. If no keyboard is found, the
|
|||||||
and
|
and
|
||||||
.Fl h
|
.Fl h
|
||||||
options are automatically set.
|
options are automatically set.
|
||||||
|
.It Fl p
|
||||||
|
pause after each attached device during the device probing phase.
|
||||||
.It Fl r
|
.It Fl r
|
||||||
use the statically configured default for the device containing the
|
use the statically configured default for the device containing the
|
||||||
root file system
|
root file system
|
||||||
|
@ -176,7 +176,7 @@ configure_final(dummy)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* cninit_finish(); */
|
cninit_finish();
|
||||||
|
|
||||||
if (bootverbose) {
|
if (bootverbose) {
|
||||||
|
|
||||||
|
@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
|
|||||||
case 'h':
|
case 'h':
|
||||||
howto |= RB_SERIAL;
|
howto |= RB_SERIAL;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
howto |= RB_PAUSE;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
howto |= RB_DFLTROOT;
|
howto |= RB_DFLTROOT;
|
||||||
break;
|
break;
|
||||||
|
@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
|
|||||||
case 'h':
|
case 'h':
|
||||||
howto |= RB_SERIAL;
|
howto |= RB_SERIAL;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
howto |= RB_PAUSE;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
howto |= RB_DFLTROOT;
|
howto |= RB_DFLTROOT;
|
||||||
break;
|
break;
|
||||||
|
@ -100,6 +100,9 @@ bi_getboothowto(char *kargs)
|
|||||||
case 'h':
|
case 'h':
|
||||||
howto |= RB_SERIAL;
|
howto |= RB_SERIAL;
|
||||||
break;
|
break;
|
||||||
|
case 'p':
|
||||||
|
howto |= RB_PAUSE;
|
||||||
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
howto |= RB_DFLTROOT;
|
howto |= RB_DFLTROOT;
|
||||||
break;
|
break;
|
||||||
|
@ -176,7 +176,7 @@ configure_final(dummy)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* cninit_finish(); */
|
cninit_finish();
|
||||||
|
|
||||||
if (bootverbose) {
|
if (bootverbose) {
|
||||||
|
|
||||||
|
@ -55,6 +55,8 @@
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
|
|
||||||
|
#include <ddb/ddb.h>
|
||||||
|
|
||||||
#include <machine/cpu.h>
|
#include <machine/cpu.h>
|
||||||
|
|
||||||
static d_open_t cnopen;
|
static d_open_t cnopen;
|
||||||
@ -112,6 +114,9 @@ static int cn_mute;
|
|||||||
static int openflag; /* how /dev/console was opened */
|
static int openflag; /* how /dev/console was opened */
|
||||||
static int cn_is_open;
|
static int cn_is_open;
|
||||||
static dev_t cn_devfsdev; /* represents the device private info */
|
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 *);
|
void cndebug(char *);
|
||||||
|
|
||||||
@ -162,12 +167,20 @@ cninit(void)
|
|||||||
cnadd(best_cn);
|
cnadd(best_cn);
|
||||||
best_cn->cn_init(best_cn);
|
best_cn->cn_init(best_cn);
|
||||||
}
|
}
|
||||||
|
if (boothowto & RB_PAUSE)
|
||||||
|
console_pausing = 1;
|
||||||
/*
|
/*
|
||||||
* Make the best console the preferred console.
|
* Make the best console the preferred console.
|
||||||
*/
|
*/
|
||||||
cnselect(best_cn);
|
cnselect(best_cn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
cninit_finish()
|
||||||
|
{
|
||||||
|
console_pausing = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* add a new physical console to back the virtual console */
|
/* add a new physical console to back the virtual console */
|
||||||
int
|
int
|
||||||
cnadd(struct consdev *cn)
|
cnadd(struct consdev *cn)
|
||||||
@ -526,6 +539,7 @@ cnputc(int c)
|
|||||||
{
|
{
|
||||||
struct cn_device *cnd;
|
struct cn_device *cnd;
|
||||||
struct consdev *cn;
|
struct consdev *cn;
|
||||||
|
char *cp;
|
||||||
|
|
||||||
if (cn_mute || c == '\0')
|
if (cn_mute || c == '\0')
|
||||||
return;
|
return;
|
||||||
@ -535,6 +549,16 @@ cnputc(int c)
|
|||||||
cn->cn_putc(cn->cn_dev, '\r');
|
cn->cn_putc(cn->cn_dev, '\r');
|
||||||
cn->cn_putc(cn->cn_dev, c);
|
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
|
void
|
||||||
|
@ -88,6 +88,7 @@ extern int cons_unavail;
|
|||||||
|
|
||||||
/* Other kernel entry points. */
|
/* Other kernel entry points. */
|
||||||
void cninit(void);
|
void cninit(void);
|
||||||
|
void cninit_finish(void);
|
||||||
int cnadd(struct consdev *);
|
int cnadd(struct consdev *);
|
||||||
void cnremove(struct consdev *);
|
void cnremove(struct consdev *);
|
||||||
void cnselect(struct consdev *);
|
void cnselect(struct consdev *);
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
|
#define RB_GDB 0x8000 /* use GDB remote debugger instead of DDB */
|
||||||
#define RB_MUTE 0x10000 /* Come up with the console muted */
|
#define RB_MUTE 0x10000 /* Come up with the console muted */
|
||||||
#define RB_SELFTEST 0x20000 /* don't boot to normal operation, do selftest */
|
#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_MULTIPLE 0x20000000 /* Use multiple consoles */
|
||||||
|
|
||||||
#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
|
#define RB_BOOTINFO 0x80000000 /* have `struct bootinfo *' arg */
|
||||||
|
Loading…
Reference in New Issue
Block a user