summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/machdep.c8
-rw-r--r--sys/kern/kern_cons.c18
-rw-r--r--sys/sys/cons.h1
3 files changed, 27 insertions, 0 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index b8999bd..82c2c89 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1955,6 +1955,14 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
clock_init();
/*
+ * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4)
+ * transition).
+ */
+ if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) !=
+ NULL)
+ vty_set_preferred(VTY_VT);
+
+ /*
* Initialize the console before we print anything out.
*/
cninit();
diff --git a/sys/kern/kern_cons.c b/sys/kern/kern_cons.c
index 1d5ac0e..6545bc9 100644
--- a/sys/kern/kern_cons.c
+++ b/sys/kern/kern_cons.c
@@ -652,6 +652,7 @@ sysbeep(int pitch __unused, int period __unused)
/*
* Temporary support for sc(4) to vt(4) transition.
*/
+static unsigned vty_prefer;
static char vty_name[16];
SYSCTL_STRING(_kern, OID_AUTO, vty, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, vty_name,
0, "Console vty driver");
@@ -676,6 +677,10 @@ vty_enabled(unsigned vty)
break;
}
#endif
+ if (vty_prefer != 0) {
+ vty_selected = vty_prefer;
+ break;
+ }
#if defined(DEV_SC)
vty_selected = VTY_SC;
#elif defined(DEV_VT)
@@ -691,3 +696,16 @@ vty_enabled(unsigned vty)
return ((vty_selected & vty) != 0);
}
+void
+vty_set_preferred(unsigned vty)
+{
+
+ vty_prefer = vty;
+#if !defined(DEV_SC)
+ vty_prefer &= ~DEV_SC;
+#endif
+#if !defined(DEV_VT)
+ vty_prefer &= ~DEV_VT;
+#endif
+}
+
diff --git a/sys/sys/cons.h b/sys/sys/cons.h
index 485f8c0..0085daa 100644
--- a/sys/sys/cons.h
+++ b/sys/sys/cons.h
@@ -137,6 +137,7 @@ void constty_clear(void);
#define VTY_SC 0x01
#define VTY_VT 0x02
int vty_enabled(unsigned int);
+void vty_set_preferred(unsigned int);
#endif /* _KERNEL */
OpenPOWER on IntegriCloud