Page MenuHomeFreeBSD

D5727.diff
No OneTemporary

D5727.diff

Index: sys/boot/i386/libi386/i386_module.c
===================================================================
--- sys/boot/i386/libi386/i386_module.c
+++ sys/boot/i386/libi386/i386_module.c
@@ -32,12 +32,35 @@
*
*/
+#include <stand.h>
+#include <string.h>
+#include <machine/cpufunc.h>
+
+/* See the kernel's function identify_hypervisor(). */
+static int
+running_on_hypervisor(void)
+{
+ unsigned int regs[4];
+
+ do_cpuid(1, regs);
+ return (regs[2] & 0x80000000);
+}
+
/*
* Use voodoo to load modules required by current hardware.
*/
int
i386_autoload(void)
{
+ if (running_on_hypervisor()) {
+ /*
+ * vt(4)'s graphics mode is slow when FreeBSD guest runs on
+ * hypervisors, especially on Hyper-V (e.g., 1 line of boot message
+ * per second), but luckily vt(4) is fast enough in text mode.
+ */
+ if (getenv("hw.vga.textmode") == NULL)
+ setenv("hw.vga.textmode", "1", 1);
+ }
/* XXX use PnP to locate stuff here */
return(0);

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 12:00 AM (14 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30853746
Default Alt Text
D5727.diff (1 KB)

Event Timeline