VirtualBox looks for FreeBSD developer

Edwin Groothuis edwin at mavetju.org
Thu Feb 28 21:20:54 UTC 2008


On Fri, Feb 29, 2008 at 12:44:36AM +1100, Edwin Groothuis wrote:
> On Tue, Feb 26, 2008 at 02:23:48PM +0100, Miroslav Lachman wrote:
> > Olivier Cochard-Labbe wrote:
> > >Hi all,
> > >In a post concerning ?porting VirtualBox on FreeBSD?, an Innotek developer
> > >answer that they start to port it, but ?hope some developers from the
> > >FreeBSD community will pick up where we left off and complete the port?.
> > >Original post here: http://forums.virtualbox.org/viewtopic.php?t=3234
> > >
> > >Are there any developers motivated here ?
> > 
> > I am not a developer, but it would be nice to have VirtualBox on FreeBSD 
> > (I am using it on Windows to run FreeBSD guests :])
> > 
> > I am available for testing etc.
> 
> Patches to get it working against the current SVN version.
> 
> Problem lies with the kernel driver. But that's an issue for other
> people to worry about later.

New patches, which actually make it compile this time :-)

This works:

[~svn/vbox/out/freebsd.x86/release] edwin at k7>export LD_LIBRARY_PATH=`pwd`/bin:`pwd`/lib
[~svn/vbox/out/freebsd.x86/release] edwin at k7>cd bin
[~svn/vbox/out/freebsd.x86/release/bin] edwin at k7>kldload vboxdrv.ko 
[~svn/vbox/out/freebsd.x86/release/bin] edwin at k7>cd ..
[~svn/vbox/out/freebsd.x86/release] edwin at k7>bin/VirtualBox 

But it still complains about the kernel driver:

VM creation failed (GVMM). VBox status code: -37 (VERR_NOT_SUPPORTED).

And panics while unloading...

I will continue on my test box (a multitude slower than my desktop
but at least I don't lose all my $realjob work when it panics)

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |              Weblog: http://www.mavetju.org/weblog/
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 7199)
+++ configure	(working copy)
@@ -60,9 +60,9 @@
 LIBXCURSOR="-lXcursor"
 INCZ=""
 LIBZ="-lz"
-INCPNG=""
-LIBPNG="-lpng"
-QTDIR="/usr/qt/3 /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
+INCPNG="-I/usr/local/include"
+LIBPNG="-L/usr/local/lib -lpng"
+QTDIR="/usr/local/ /usr/lib/qt3 /usr/lib/qt-3.3 /usr/share/qt3 /usr/lib64/qt-3.3 /usr/X11R6 /usr/lib/qt"
 KBUILDDIR="`cd \`dirname $0\`; pwd`/kBuild"
 DEVDIR="`cd \`dirname $0\`; pwd`/tools"
 if [ -d "/lib/modules/`uname -r`/build" ]; then
@@ -573,6 +573,7 @@
           if test_execute; then
             cnf_append "SDK_VBOX_LIBXML2_INCS" "$INCXML2"
             cnf_append "SDK_VBOX_LIBXML2_LIBS" "`strip_l "$LIBXML2"`"
+	    cnf_append "SDK_VBOX_LIBXML2_LIBPATH" "`strip_L "$LIBXML2"`"
           fi
         fi
       fi
Index: Config.kmk
===================================================================
--- Config.kmk	(revision 7199)
+++ Config.kmk	(working copy)
@@ -345,14 +345,19 @@
 endif
 
 ifeq ($(BUILD_TARGET),freebsd)
- VBOX_WITH_INSTALLER=
  VBOX_WITH_SECURELABEL=
  VBOX_WITH_VRDP_AUTHMOD=
  VBOX_WITH_VRDP_RDESKTOP=
  VBOX_WITH_TESTSUITE=
+ VBOX_WITH_EHCI=
+
+ VBOX_WITH_INSTALLER=
  VBOX_WITH_USB=
- VBOX_WITH_EHCI=
  VBOX_WITH_DOCS=
+#VBOX_WITH_INSTALLER=
+#VBOX_WITH_USB=
+#VBOX_WITH_DOCS=
+# XXX Mavvie
 endif
 
 
Index: src/VBox/VMM/VMMR0/HWACCMR0A.asm
===================================================================
--- src/VBox/VMM/VMMR0/HWACCMR0A.asm	(revision 7199)
+++ src/VBox/VMM/VMMR0/HWACCMR0A.asm	(working copy)
@@ -24,6 +24,22 @@
 %include "VBox/cpum.mac"
 %include "VBox/x86.mac"
 
+%ifdef RT_OS_FREEBSD ;; @todo fix OMF support in yasm and kick nasm out completely.
+ %macro vmwrite 2,
+    int3
+ %endmacro
+ %define vmlaunch int3
+ %define vmresume int3
+ %define vmsave int3
+ %define vmload int3
+ %define vmrun int3
+ %define clgi int3
+ %define stgi int3
+ %macro invlpga 2,
+    int3
+ %endmacro
+%endif
+
 %ifdef RT_OS_OS2 ;; @todo fix OMF support in yasm and kick nasm out completely.
  %macro vmwrite 2,
     int3
Index: src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- src/VBox/Main/ConsoleImpl.cpp	(revision 7199)
+++ src/VBox/Main/ConsoleImpl.cpp	(working copy)
@@ -18,15 +18,21 @@
 #include <iprt/types.h> /* for stdint.h constants */
 
 #if defined(RT_OS_WINDOWS)
-#elif defined(RT_OS_LINUX)
+#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
 #   include <errno.h>
 #   include <sys/ioctl.h>
 #   include <sys/poll.h>
 #   include <sys/fcntl.h>
 #   include <sys/types.h>
 #   include <sys/wait.h>
+#if defined(RT_OS_FREEBSD)
+#   include <sys/types.h>
+#   include <sys/socket.h>
+#endif
 #   include <net/if.h>
+#if defined(RT_OS_LINUX)
 #   include <linux/if_tun.h>
+#endif
 #   include <stdio.h>
 #   include <stdlib.h>
 #   include <string.h>


More information about the freebsd-ports mailing list