diff options
author | Toomas Soome <tsoome@me.com> | 2019-05-29 13:57:06 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-06-27 22:11:48 +0300 |
commit | 7bc07ca370133372a1f6a809c593d21722732630 (patch) | |
tree | 16cc1d0fe5c385af5ee725e7ccc7527cea951043 | |
parent | c781d872ea5682df2959cfd41499cf419840900f (diff) | |
download | illumos-joyent-7bc07ca370133372a1f6a809c593d21722732630.tar.gz |
11080 loader: provide knob to keep text mode
Reviewed by: C Fraire <cfraire@me.com>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/boot/sys/boot/common/rbx.h | 11 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c | 5 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/libi386/vidconsole.c | 3 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/loader/main.c | 17 |
4 files changed, 19 insertions, 17 deletions
diff --git a/usr/src/boot/sys/boot/common/rbx.h b/usr/src/boot/sys/boot/common/rbx.h index 21371a5638..5fdb9075b2 100644 --- a/usr/src/boot/sys/boot/common/rbx.h +++ b/usr/src/boot/sys/boot/common/rbx.h @@ -1,4 +1,4 @@ -/*- +/* * Copyright (c) 1998 Robert Nordier * All rights reserved. * @@ -11,8 +11,6 @@ * implied warranties, including, without limitation, the implied * warranties of merchantability and fitness for a particular * purpose. - * - * $FreeBSD$ */ #ifndef _RBX_H_ @@ -37,7 +35,7 @@ #define RBX_MUTE 0x10 /* -m */ /* 0x11 is reserved for log2(RB_SELFTEST). */ /* 0x12 is reserved for boot programs. */ -/* 0x13 is reserved for boot programs. */ +#define RBX_TEXT_MODE 0x13 /* -t */ #define RBX_PAUSE 0x14 /* -p */ #define RBX_QUIET 0x15 /* -q */ #define RBX_NOINTR 0x1c /* -n */ @@ -45,13 +43,14 @@ #define RBX_DUAL 0x1d /* -D */ /* 0x1f is reserved for log2(RB_BOOTINFO). */ -/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D */ +/* pass: -a, -s, -r, -d, -c, -v, -h, -C, -g, -m, -p, -D, -t */ #define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ OPT_SET(RBX_SERIAL) | OPT_SET(RBX_CDROM) | \ OPT_SET(RBX_GDB ) | OPT_SET(RBX_MUTE) | \ - OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL)) + OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL) | \ + OPT_SET(RBX_TEXT_MODE)) #define OPT_SET(opt) (1 << (opt)) #define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c index 3c5166005d..c19debdeb7 100644 --- a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c +++ b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c @@ -48,7 +48,7 @@ #include "libzfs.h" #define ARGS 0x900 -#define NOPT 14 +#define NOPT 15 #define NDEV 3 #define BIOS_NUMDRIVES 0x475 @@ -70,7 +70,7 @@ extern uint32_t _end; extern const struct multiboot_header mb_header; extern uint64_t start_sector; -static const char optstr[NOPT] = "DhaCcdgmnpqrsv"; /* Also 'P', 'S' */ +static const char optstr[NOPT] = "DhaCcdgmnpqrstv"; /* Also 'P', 'S' */ static const unsigned char flags[NOPT] = { RBX_DUAL, RBX_SERIAL, @@ -85,6 +85,7 @@ static const unsigned char flags[NOPT] = { RBX_QUIET, RBX_DFLTROOT, RBX_SINGLE, + RBX_TEXT_MODE, RBX_VERBOSE }; uint32_t opts; diff --git a/usr/src/boot/sys/boot/i386/libi386/vidconsole.c b/usr/src/boot/sys/boot/i386/libi386/vidconsole.c index d506c93798..2927c3cabb 100644 --- a/usr/src/boot/sys/boot/i386/libi386/vidconsole.c +++ b/usr/src/boot/sys/boot/i386/libi386/vidconsole.c @@ -40,6 +40,7 @@ #include "libi386.h" #include "vbe.h" #include <gfx_fb.h> +#include <rbx.h> #include <sys/vgareg.h> #include <sys/vgasubr.h> #include <machine/cpufunc.h> @@ -666,7 +667,7 @@ vidc_init(struct console *cp, int arg) /* default to text mode */ cp->c_private = &text_ops; - if (vbe_available()) { + if (OPT_CHECK(RBX_TEXT_MODE) == 0 && vbe_available()) { rc = vbe_default_mode(); /* if rc is not legal VBE mode, use text mode */ if (VBE_VALID_MODE(rc)) { diff --git a/usr/src/boot/sys/boot/i386/loader/main.c b/usr/src/boot/sys/boot/i386/loader/main.c index 8864209ae8..32c3cdef34 100644 --- a/usr/src/boot/sys/boot/i386/loader/main.c +++ b/usr/src/boot/sys/boot/i386/loader/main.c @@ -40,6 +40,7 @@ #include <sys/disk.h> #include <sys/param.h> #include <sys/reboot.h> +#include <rbx.h> #include "bootstrap.h" #include "common/bootargs.h" @@ -54,9 +55,9 @@ CTASSERT(offsetof(struct bootargs, bootflags) == BA_BOOTFLAGS); CTASSERT(offsetof(struct bootinfo, bi_size) == BI_SIZE); /* Arguments passed in from the boot1/boot2 loader */ -static struct bootargs *kargs; +struct bootargs *kargs; -static uint32_t initial_howto; +uint32_t opts; static uint32_t initial_bootdev; static struct bootinfo *initial_bootinfo; @@ -81,7 +82,7 @@ main(void) /* Pick up arguments */ kargs = (void *)__args; - initial_howto = kargs->howto; + opts = kargs->howto; initial_bootdev = kargs->bootdev; initial_bootinfo = kargs->bootinfo ? (struct bootinfo *)PTOV(kargs->bootinfo) : NULL; @@ -116,15 +117,15 @@ main(void) * If the previous boot stage has requested a serial console, * prefer that. */ - bi_setboothowto(initial_howto); - if (initial_howto & RB_MULTIPLE) { - if (initial_howto & RB_SERIAL) + bi_setboothowto(opts); + if (OPT_CHECK(RBX_DUAL)) { + if (OPT_CHECK(RBX_SERIAL)) setenv("console", "ttya text", 1); else setenv("console", "text ttya", 1); - } else if (initial_howto & RB_SERIAL) { + } else if (OPT_CHECK(RBX_SERIAL)) { setenv("console", "ttya", 1); - } else if (initial_howto & RB_MUTE) { + } else if (OPT_CHECK(RBX_MUTE)) { setenv("console", "null", 1); } cons_probe(); |