summaryrefslogtreecommitdiffstats
path: root/sys/boot/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/i386')
-rw-r--r--sys/boot/i386/libi386/bootinfo.c36
-rw-r--r--sys/boot/i386/loader/main.c12
2 files changed, 39 insertions, 9 deletions
diff --git a/sys/boot/i386/libi386/bootinfo.c b/sys/boot/i386/libi386/bootinfo.c
index 85638fe..623351c 100644
--- a/sys/boot/i386/libi386/bootinfo.c
+++ b/sys/boot/i386/libi386/bootinfo.c
@@ -59,10 +59,12 @@ int
bi_getboothowto(char *kargs)
{
char *cp;
+ char *curpos, *next, *string;
int howto;
int active;
int i;
-
+ int vidconsole;
+
/* Parse kargs */
howto = 0;
if (kargs != NULL) {
@@ -117,10 +119,34 @@ bi_getboothowto(char *kargs)
for (i = 0; howto_names[i].ev != NULL; i++)
if (getenv(howto_names[i].ev) != NULL)
howto |= howto_names[i].mask;
- if (!strcmp(getenv("console"), "comconsole"))
- howto |= RB_SERIAL;
- if (!strcmp(getenv("console"), "nullconsole"))
- howto |= RB_MUTE;
+
+ /* Enable selected consoles */
+ string = next = strdup(getenv("console"));
+ vidconsole = 0;
+ while (next != NULL) {
+ curpos = strsep(&next, " ,");
+ if (*curpos == '\0')
+ continue;
+ if (!strcmp(curpos, "vidconsole"))
+ vidconsole = 1;
+ else if (!strcmp(curpos, "comconsole"))
+ howto |= RB_SERIAL;
+ else if (!strcmp(curpos, "nullconsole"))
+ howto |= RB_MUTE;
+ }
+
+ if (vidconsole && (howto & RB_SERIAL))
+ howto |= RB_MULTIPLE;
+
+ /*
+ * XXX: Note that until the kernel is ready to respect multiple consoles
+ * for the boot messages, the first named console is the primary console
+ */
+ if (!strcmp(string, "vidconsole"))
+ howto &= ~RB_SERIAL;
+
+ free(string);
+
return(howto);
}
diff --git a/sys/boot/i386/loader/main.c b/sys/boot/i386/loader/main.c
index 2282309..1e2f568 100644
--- a/sys/boot/i386/loader/main.c
+++ b/sys/boot/i386/loader/main.c
@@ -98,12 +98,16 @@ main(void)
* We can use printf() etc. once this is done.
* If the previous boot stage has requested a serial console, prefer that.
*/
- if (initial_howto & RB_SERIAL)
+ if (initial_howto & RB_MULTIPLE) {
+ setenv("boot_multicons", "YES", 1);
+ if (initial_howto & RB_SERIAL)
+ setenv("console", "comconsole vidconsole", 1);
+ else
+ setenv("console", "vidconsole comconsole", 1);
+ } else if (initial_howto & RB_SERIAL)
setenv("console", "comconsole", 1);
- if (initial_howto & RB_MUTE)
+ else if (initial_howto & RB_MUTE)
setenv("console", "nullconsole", 1);
- if (initial_howto & RB_MULTIPLE)
- setenv("boot_multicons", "YES", 1);
cons_probe();
/*
OpenPOWER on IntegriCloud