VirtualBox

Changeset 23526 in vbox


Ignore:
Timestamp:
Oct 3, 2009 5:55:49 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53169
Message:

HostDrivers/FreeBSD: Use the same method to build the kernel drivers as Linux.

To build the kernel drivers go into out/freebsd.{amd64,x86}/{release,debug}/bin/src
after the build and execute make. make load will load the kernel drivers.
The old way is only used for syntax checking and the resulting modules may not even load anymore.

Location:
trunk/src/VBox/HostDrivers
Files:
7 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Makefile.kmk

    r23452 r23526  
    4141 endif
    4242
    43  ifeq ($(KBUILD_TARGET),linux)
     43 if1of ($(KBUILD_TARGET),linux freebsd)
    4444  #
    45   # Install the Makefile for module compliation on Linux hosts
     45  # Install the Makefile for module compliation on Linux and FreeBSD hosts
    4646  #
    4747  INSTALLS += HostDrivers-src
    4848  HostDrivers-src_INST    = bin/src/
    4949  HostDrivers-src_MODE    = a+r,u+w
    50   HostDrivers-src_SOURCES = linux/Makefile
     50  HostDrivers-src_SOURCES.linux = linux/Makefile
     51  HostDrivers-src_SOURCES.freebsd = freebsd/Makefile
    5152 endif
    5253
     54 if1of ($(KBUILD_TARGET),freebsd)
     55  #
     56  # Install the export_modules script for tar'ing the module sources on FreeBSD hosts
     57  #
     58  INSTALLS += HostDrivers-sh
     59  HostDrivers-sh_INST    = bin/
     60  HostDrivers-sh_MODE    = a+rx,u+w
     61  HostDrivers-sh_SOURCES.freebsd = freebsd/export_modules
     62 endif
    5363endif # !VBOX_ONLY_DOCS
    5464
  • trunk/src/VBox/HostDrivers/Support/Makefile.kmk

    r22077 r23526  
    5252 endif
    5353 INSTALLS.linux   += vboxdrv-mod vboxdrv-sh
     54 INSTALLS.freebsd += vboxdrv-mod vboxdrv-sh
    5455
    5556 #
     
    6162 # Populate FILES_VBOXDRV_NOBIN and FILES_VBOXDRV_BIN
    6263 #
    63  include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
     64 ifeq ($(KBUILD_TARGET),linux)
     65  include $(PATH_SUB_CURRENT)/linux/files_vboxdrv
     66 endif
     67 ifeq ($(KBUILD_TARGET),freebsd)
     68  include $(PATH_SUB_CURRENT)/freebsd/files_vboxdrv
     69 endif
    6470endif # !VBOX_ONLY_DOCS
    6571
     
    409415        SUPDrv.c
    410416## @todo the SUPDrv-freebsd.def is most probably gonna break it and require build system hacking...
     417
     418#
     419# Targets for installing the freebsd sources.
     420#
     421vboxdrv-mod_INST    = bin/src/vboxdrv/
     422vboxdrv-mod_MODE    = a+r,u+w
     423vboxdrv-mod_SOURCES = $(subst ",,$(FILES_VBOXDRV_NOBIN)) #"
     424vboxdrv-mod_SOURCES += \
     425        $(PATH_vboxdrv-mod)/Makefile
     426vboxdrv-mod_CLEAN   = \
     427        $(PATH_vboxdrv-mod)/Makefile
    411428endif # freebsd
    412429
     430$$(PATH_vboxdrv-mod)/Makefile: \
     431                $(PATH_SUB_CURRENT)/freebsd/Makefile \
     432                $$(if $$(eq $$(Support/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
     433                | $$(dir $$@)
     434        $(call MSG_TOOL,Creating,,$@)
     435 ifndef VBOX_WITH_HARDENING
     436        $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
     437 else
     438        $(QUIET)$(CP) -f $< $@
     439 endif
    413440
    414441#
  • trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h

    r22615 r23526  
    123123#   define strchr  libkern_strchr
    124124#   define strrchr libkern_strrchr
    125 #   define ffs     libkern_ffs
    126125#   define ffsl    libkern_ffsl
    127126#   define fls     libkern_fls
  • trunk/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk

    r23082 r23526  
    153153endif # linux
    154154
     155ifeq ($(KBUILD_TARGET),freebsd)
     156 #
     157 # Install source files for compliation on FreeBSD.
     158 # files_vboxnetadp defines VBOX_VBOXNETADP_SOURCES.
     159 #
     160 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetadp
     161 INSTALLS += VBoxNetAdp-src
     162 VBoxNetAdp-src_INST    = bin/src/vboxnetadp/
     163 VBoxNetAdp-src_MODE    = a+r,u+w
     164 VBoxNetAdp-src_SOURCES = $(subst ",,$(VBOX_VBOXNETADP_SOURCES)) #"
     165 VBoxNetAdp-src_SOURCES+= \
     166        $(PATH_VBoxNetAdp-src)/Makefile
     167 VBoxNetAdp-src_CLEAN   = \
     168        $(PATH_VBoxNetAdp-src)/Makefile \
     169
     170$$(PATH_VBoxNetAdp-src)/Makefile: \
     171                $(PATH_SUB_CURRENT)/freebsd/Makefile \
     172                $$(if $$(eq $$(VBoxNetAdp/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
     173                | $$(dir $$@)
     174ifndef VBOX_WITH_HARDENING
     175        $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
     176else
     177        $(QUIET)$(CP) -f $< $@
     178endif
     179
     180endif # freebsd
     181
    155182include $(KBUILD_PATH)/subfooter.kmk
    156183
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk

    r23452 r23526  
    401401$(PATH_OUT)/opt_netgraph.h:
    402402        echo > $(PATH_OUT)/opt_netgraph.h
     403
     404 #
     405 # Install source files for compliation on FreeBSD.
     406 # files_vboxnetflt defines VBOX_VBOXNETFLT_SOURCES.
     407 #
     408 include $(PATH_SUB_CURRENT)/freebsd/files_vboxnetflt
     409 INSTALLS += VBoxNetFlt-src
     410 VBoxNetFlt-src_INST    = bin/src/vboxnetflt/
     411 VBoxNetFlt-src_MODE    = a+r,u+w
     412 VBoxNetFlt-src_SOURCES = $(subst ",,$(VBOX_VBOXNETFLT_SOURCES)) #"
     413 VBoxNetFlt-src_SOURCES+= \
     414        $(PATH_VBoxNetFlt-src)/Makefile
     415 VBoxNetFlt-src_CLEAN   = \
     416        $(PATH_VBoxNetFlt-src)/Makefile \
     417
     418 $$(PATH_VBoxNetFlt-src)/Makefile: \
     419                $(PATH_SUB_CURRENT)/freebsd/Makefile \
     420                $$(if $$(eq $$(VBoxNetFlt/freebsd/Makefile_VBOX_HARDENED),$$(VBOX_WITH_HARDENING)),,FORCE) \
     421                | $$(dir $$@)
     422 ifndef VBOX_WITH_HARDENING
     423        $(QUIET)$(SED) -e "s;-DVBOX_WITH_HARDENING;;g" --output $@ $<
     424 else
     425        $(QUIET)$(CP) -f $< $@
     426 endif
    403427endif # freebsd
    404428
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c

    r22902 r23526  
    146146            if (RT_FAILURE(rc))
    147147            {
    148                 Log(("RTR0Init failed %d\n", rc));
     148                printf("RTR0Init failed %d\n", rc);
    149149                return RTErrConvertToErrno(rc);
    150150            }
     
    154154            if (RT_FAILURE(rc))
    155155            {
    156                 Log(("vboxNetFltInitGlobalsAndIdc failed %d\n", rc));
     156                printf("vboxNetFltInitGlobalsAndIdc failed %d\n", rc);
    157157                return RTErrConvertToErrno(rc);
    158158            }
Note: See TracChangeset for help on using the changeset viewer.

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