Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F150777311
D5727.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5727.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5727: loader: set hw.vga.textmode=1 on hypervisors
Attached
Detach File
Event Timeline
Log In to Comment