diff options
author | guido <guido@FreeBSD.org> | 2001-12-10 20:02:22 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 2001-12-10 20:02:22 +0000 |
commit | d779575f7846876b380fa2aad5649f2147253f95 (patch) | |
tree | 2c02555b14b96857d5aafe414d930838b85fc62f | |
parent | 898745463bbc3e735f3319dc79dd135b505f3b35 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sbin/reboot/boot_i386.8 | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/autoconf.c | 2 | ||||
-rw-r--r-- | sys/boot/i386/libi386/bootinfo.c | 3 | ||||
-rw-r--r-- | sys/boot/i386/libi386/bootinfo32.c | 3 | ||||
-rw-r--r-- | sys/boot/i386/libi386/bootinfo64.c | 3 | ||||
-rw-r--r-- | sys/i386/i386/autoconf.c | 2 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 24 | ||||
-rw-r--r-- | sys/sys/cons.h | 1 | ||||
-rw-r--r-- | sys/sys/reboot.h | 1 |
9 files changed, 39 insertions, 2 deletions
diff --git a/sbin/reboot/boot_i386.8 b/sbin/reboot/boot_i386.8 index 05c44c7..2879a3a 100644 --- a/sbin/reboot/boot_i386.8 +++ b/sbin/reboot/boot_i386.8 @@ -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 diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c index 95943cd..a816eed 100644 --- a/sys/amd64/amd64/autoconf.c +++ b/sys/amd64/amd64/autoconf.c @@ -176,7 +176,7 @@ configure_final(dummy) { int i; -/* cninit_finish(); */ + cninit_finish(); if (bootverbose) { diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c index 8e5c752..1c6b1d2 100644 --- a/sys/boot/i386/libi386/bootinfo.c +++ b/sys/boot/i386/libi386/bootinfo.c @@ -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; diff --git a/sys/boot/i386/libi386/bootinfo32.c b/sys/boot/i386/libi386/bootinfo32.c index 8e5c752..1c6b1d2 100644 --- a/sys/boot/i386/libi386/bootinfo32.c +++ b/sys/boot/i386/libi386/bootinfo32.c @@ -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; diff --git a/sys/boot/i386/libi386/bootinfo64.c b/sys/boot/i386/libi386/bootinfo64.c index 8e5c752..1c6b1d2 100644 --- a/sys/boot/i386/libi386/bootinfo64.c +++ b/sys/boot/i386/libi386/bootinfo64.c @@ -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; diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index 95943cd..a816eed 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/i386/autoconf.c @@ -176,7 +176,7 @@ configure_final(dummy) { int i; -/* cninit_finish(); */ + cninit_finish(); if (bootverbose) { 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 diff --git a/sys/sys/cons.h b/sys/sys/cons.h index 73f2e9d..a65647e 100644 --- a/sys/sys/cons.h +++ b/sys/sys/cons.h @@ -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 *); diff --git a/sys/sys/reboot.h b/sys/sys/reboot.h index 19e7cc3..0a45bcb 100644 --- a/sys/sys/reboot.h +++ b/sys/sys/reboot.h @@ -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 */ |