Index: sys/boot/forth/vm.4th =================================================================== RCS file: sys/boot/forth/vm.4th diff -N sys/boot/forth/vm.4th --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ sys/boot/forth/vm.4th 2 Jan 2008 15:38:41 -0000 @@ -0,0 +1,35 @@ +: check-env? ( addr len addr len -- flag ) + getenv + dup -1 <> if + compare 0= if + true exit + then + else + drop + 2drop + then + false +; + +: is-vm? ( -- flag ) + s" QEMU " s" hint.acpi.0.oem" check-env? if + true exit + then + s" VBOX " s" hint.acpi.0.oem" check-env? if + true exit + then + s" VMware, Inc." s" smbios.system.maker" check-env? if + true exit + then + s" Parallels Software International Inc." s" smbios.bios.vendor" + check-env? if + true exit + then + false +; + +: setup-vm + is-vm? if + s" 100" s" hz" setenv + then +; Index: sys/boot/i386/loader/Makefile =================================================================== RCS file: /usr/cvs/src/sys/boot/i386/loader/Makefile,v retrieving revision 1.85 diff -u -r1.85 Makefile --- sys/boot/i386/loader/Makefile 29 May 2007 14:35:57 -0000 1.85 +++ sys/boot/i386/loader/Makefile 2 Jan 2008 15:48:06 -0000 @@ -84,7 +84,7 @@ .PATH: ${.CURDIR}/../../forth FILES= loader loader.help loader.4th support.4th loader.conf -FILES+= screen.4th frames.4th beastie.4th +FILES+= screen.4th frames.4th beastie.4th vm.4th # XXX INSTALLFLAGS_loader= -b FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults Index: sys/boot/i386/loader/loader.rc =================================================================== RCS file: /usr/cvs/src/sys/boot/i386/loader/loader.rc,v retrieving revision 1.4 diff -u -r1.4 loader.rc --- sys/boot/i386/loader/loader.rc 30 Oct 2005 05:41:42 -0000 1.4 +++ sys/boot/i386/loader/loader.rc 2 Jan 2008 15:38:52 -0000 @@ -4,6 +4,10 @@ \ Includes additional commands include /boot/loader.4th +\ Virtual machine detection +include /boot/vm.4th +setup-vm + \ Reads and processes loader.conf variables start