summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_cons.c
diff options
context:
space:
mode:
authorguido <guido@FreeBSD.org>2001-12-10 20:02:22 +0000
committerguido <guido@FreeBSD.org>2001-12-10 20:02:22 +0000
commitd779575f7846876b380fa2aad5649f2147253f95 (patch)
tree2c02555b14b96857d5aafe414d930838b85fc62f /sys/kern/tty_cons.c
parent898745463bbc3e735f3319dc79dd135b505f3b35 (diff)
downloadFreeBSD-src-d779575f7846876b380fa2aad5649f2147253f95.zip
FreeBSD-src-d779575f7846876b380fa2aad5649f2147253f95.tar.gz
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
Diffstat (limited to 'sys/kern/tty_cons.c')
-rw-r--r--sys/kern/tty_cons.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index d25e420..ad75205 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -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
OpenPOWER on IntegriCloud