VirtualBox

Changeset 7517 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Mar 22, 2008 11:15:44 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
28986
Message:

Additions/FreeBSD: initial commit

Mostly tested on FreeBSD 7.0.

Working: the additions kernel module

VBoxService (working on FreeBSD 6.2 too)
vboxvideo

Partially working: vboxmouse - 100% CPU usage and clicking does not work yet
Not tested: xclient
TODO: shared folder module is currently a stub

Installer and startup scripts

Location:
trunk/src/VBox/Additions/common
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/Makefile.kmk

    r6138 r7517  
    2222# Include sub-makefile.
    2323include $(PATH_SUB_CURRENT)/VBoxGuestLib/Makefile.kmk
    24 if1of ($(BUILD_TARGET),os2 solaris)
     24if1of ($(BUILD_TARGET),os2 solaris freebsd)
    2525include $(PATH_SUB_CURRENT)/VBoxGuest/Makefile.kmk
    2626include $(PATH_SUB_CURRENT)/VBoxService/Makefile.kmk
  • trunk/src/VBox/Additions/common/VBoxGuest/Makefile.kmk

    r6711 r7517  
    8282        $(VBOX_LIB_VBGL_R0BASE) \
    8383        $(VBOX_LIB_IPRT_GUEST_R0)
    84  
     84
     85else if1of ($(BUILD_TARGET),freebsd)
     86 #
     87 # vboxguest - The Guest Additions Driver
     88 #
     89
     90 SYSMODS.freebsd        += vboxguest
     91 vboxguest_TEMPLATE      = VBOXGUESTR0
     92 vboxguest_DEFS          = VBGL_VBOXGUEST VBOX_HGCM
     93 vboxguest_INCS          = \
     94        $(PATH_SUB_CURRENT) \
     95        $(PATH_TARGET)
     96 vboxguest_DEPS          = \
     97        $(PATH_TARGET)/pci_if.h \
     98        $(PATH_TARGET)/bus_if.h \
     99        $(PATH_TARGET)/device_if.h
     100 vboxguest_SOURCES       = \
     101        VBoxGuest-$(BUILD_TARGET).c \
     102        VBoxGuest.cpp
     103 vboxguest_LIBS          = \
     104        $(VBOX_LIB_VBGL_R0BASE) \
     105        $(VBOX_LIB_IPRT_GUEST_R0)
     106 vboxguest_CLEAN        += \
     107        $(PATH_TARGET)/pci_if.h \
     108        $(PATH_TARGET)/bus_if.h \
     109        $(PATH_TARGET)/device_if.h
     110
     111 # We need to generate some headers with awk to make building work
     112 VBOX_AWKCMD := /usr/bin/awk
     113
     114 # We cannot give a path to the awk program where the header should be generated but can only
     115 # make it produce the header at the location of the source file rather than in the current directory.
     116 # Thatshwy we copy the source file to the destination of the header first and execute the program with the copied file
     117 # afterwards.
     118 $(PATH_TARGET)/bus_if.h: $(VBOX_FREEBSD_SRC)/kern/bus_if.m
     119        $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
     120        $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/bus_if.m $(PATH_TARGET)/bus_if.m
     121        $(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/bus_if.m -h -p
     122        $(QUIET)$(RM) $(PATH_TARGET)/bus_if.m
     123
     124 $(PATH_TARGET)/device_if.h: $(VBOX_FREEBSD_SRC)/kern/device_if.m
     125        $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
     126        $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/kern/device_if.m $(PATH_TARGET)/device_if.m
     127        $(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/device_if.m -h -p
     128        $(QUIET)$(RM) $(PATH_TARGET)/device_if.m
     129
     130 $(PATH_TARGET)/pci_if.h: $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m
     131        $(call MSG_TOOL,awk,VBoxGuest,$<,$@)
     132        $(QUIET)$(CP) -f $(VBOX_FREEBSD_SRC)/dev/pci/pci_if.m $(PATH_TARGET)/pci_if.m
     133        $(QUIET)$(VBOX_AWKCMD) -f $(VBOX_FREEBSD_SRC)/tools/makeobjops.awk $(PATH_TARGET)/pci_if.m -h -p
     134        $(QUIET)$(RM) $(PATH_TARGET)/pci_if.m
     135
    85136endif
    86137
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp

    r6020 r7517  
    5858    }
    5959
    60 #elif defined(RT_OS_LINUX)
     60#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
    6161    NOREF(ppvCtx);
    6262    NOREF(pv);
     
    9292    }
    9393
    94 #elif defined(RT_OS_LINUX)
     94#elif defined(RT_OS_LINUX) || defined(RT_OS_FREEBSD)
    9595    NOREF(pvCtx);
    9696
     
    138138extern DECLVBGL(int) VBoxGuestSolarisServiceCall (void *pvOpaque, unsigned int iCmd, void *pvData, size_t cbSize, size_t *pcbReturn);
    139139__END_DECLS
     140
     141#elif defined (RT_OS_FREEBSD)
     142__BEGIN_DECLS
     143extern DECLVBGL(void *) VBoxGuestFreeBSDServiceOpen (uint32_t *pu32Version);
     144extern DECLVBGL(void) VBoxGuestFreeBSDServiceClose (void *pvOpaque);
     145extern DECLVBGL(int) VBoxGuestFreeBSDServiceCall (void *pvOpaque, unsigned int iCmd, void *pvData, size_t cbSize, size_t *pcbReturn);
     146__END_DECLS
     147
    140148#endif
    141149
     
    194202    if (    pDriver->pvOpaque
    195203        &&  u32VMMDevVersion == VMMDEV_VERSION)
     204        return VINF_SUCCESS;
     205
     206    Log(("vbglDriverOpen: failed\n"));
     207    return VERR_FILE_NOT_FOUND;
     208
     209#elif defined (RT_OS_FREEBSD)
     210    uint32_t u32VMMDevVersion;
     211    pDriver->pvOpaque = VBoxGuestFreeBSDServiceOpen(&u32VMMDevVersion);
     212    if (pDriver->pvOpaque && (u32VMMDevVersion == VMMDEV_VERSION))
    196213        return VINF_SUCCESS;
    197214
     
    260277    return VBoxGuestSolarisServiceCall(pDriver->pvOpaque, u32Function, pvData, cbData, NULL);
    261278
     279#elif defined (RT_OS_FREEBSD)
     280    return VBoxGuestFreeBSDServiceCall(pDriver->pvOpaque, u32Function, pvData, cbData, NULL);
     281
    262282#else
    263283# error "Port me"
     
    280300    VBoxGuestSolarisServiceClose (pDriver->pvOpaque);
    281301
     302#elif defined (RT_OS_FREEBSD)
     303    VBoxGuestFreeBSDServiceClose(pDriver->pvOpaque);
     304
    282305#else
    283306# error "Port me"
  • trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.h

    r6020 r7517  
    5757#elif defined (RT_OS_SOLARIS)
    5858    void *pvOpaque;
     59#elif defined (RT_OS_FREEBSD)
     60    void *pvOpaque;
    5961#else
    6062# error "Port me"
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r6569 r7517  
    2424# define INCL_ERRORS
    2525# include <os2.h>
    26 #elif defined(RT_OS_SOLARIS)
     26#elif defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    2727# include <sys/types.h>
    2828# include <sys/stat.h>
     
    226226    return RTErrConvertFromOS2(rc);
    227227
    228 #elif defined(RT_OS_SOLARIS)
     228#elif defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    229229    VBGLBIGREQ Hdr;
    230230    Hdr.u32Magic = VBGLBIGREQ_MAGIC;
     
    244244    /* PORTME - This is preferred over the RTFileIOCtl variant below, just be careful with the (int). */
    245245/** @todo test status code passing! */
     246   
    246247    int rc = xf86ioctl(g_File, iFunction, pvData);
    247248    if (rc == -1)
  • trunk/src/VBox/Additions/common/VBoxService/Makefile.kmk

    r6469 r7517  
    4343        $(VBOX_LIB_IPRT_GUEST_R3) \
    4444        $(VBOX_LIB_VBGL_R3)
    45 
     45VBoxService_LIBS.freebsd = \
     46        iconv
     47VBoxService_LIBPATH.freebsd = \
     48        /usr/local/lib
    4649include $(PATH_KBUILD)/subfooter.kmk
    4750
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceInternal.h

    r6136 r7517  
    9393extern int VBoxServiceArgUInt32(int argc, char **argv, const char *psz, int *pi, uint32_t *pu32, uint32_t u32Min, uint32_t u32Max);
    9494
    95 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)
     95#if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
    9696extern int daemon(int, int);
    9797#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette