Build on windows Build on Linux

Build on windows

Windows build prerequisites

  1. Install Visual C++ 2010 Express. if you have full edition, that is great. or you can download free Express edition. Click here, If you have other version of Visual C++, instead of 2010.

  2. Microsoft .NET Framework 4

  3. Windows Platform SDK v7.1

  4. Windows Driver Development Kit (WDK) v7.1.

  5. Install Microsoft Visual C++ 2010 Service Pack 1

  6. Install Microsoft Visual Studio 2010 Service Pack 1.

  7. LibJpeg-turbo, I am using 1.3. download libjpeg-turbo-1.3.0-vc64.exe for 64bit, libjpeg-turbo-1.3.0-vc.exe for 32bit. if you just want build driver only, then you do not need LibJpeg-turbo.

Windows build

  1. Change to the root directory and execute our configure script to setup your build environment(suppose libjpeg-turbo installed to c:\libjpeg-turbo): cscript configure.vbs --with-libjpeg=c:\libjpeg-turbo. if you just want build driver only, you do not need LibJpeg, just enter: cscript configure.vbs --driver-only

  2. Change to the root directory of the sources and enter our build shell environment: env.bat

  3. To build a release package, type kmk. This produces the binaries in out\win.x86\release\bin. If you want to build a debug version, enter kmk KBUILD_TYPE=debug. if you want build 64bit version. enter kmk KBUILD_TARGET_ARCH=amd64

I want use other Virtual C++ instead of 2010.

configure.vbs will output two files: AutoConfig.kmk containing information where to find the tools on your system and env.bat, a batch file to setup your environment for building. So you have two choices.

  1. Change configure.vbs to make it can detect your Visual C++ correctly.

  2. Do not run cscript configure.vbs, and manully edit AutoConfig.kmk and env.bat. here is the example of AutoConfig.kmk and evn.bat:


    # -*- Makefile -*-
    # Build configuration generated by cscript configure.vbs --with-libjpeg=c:\libjpeg-turbo64
    VBOX_OSE := 1
    PATH_SDK_WINDDK71     := C:/WinDDK/7600.16385.1
    VBOX_WITH_WDDM_W8     := 
    PATH_TOOL_VCC100      := C:/PROGRA~1/MICROS~2.0/VC
    PATH_TOOL_VCC100X86   := $(PATH_TOOL_VCC100)
    PATH_SDK_WINPSDK71    := C:/PROGRA~1/MICROS~3/Windows/v7.1
    VBOX_WINPSDK          := WINPSDK71
    PATH_SDK_LIBJPEG       := C:/libjpeg-turbo64


    @echo off
    rem Environment setup script generated by cscript configure.vbs --with-libjpeg=c:\libjpeg-turbo64
    set KBUILD_PATH=C:/dev/MyVbox/kBuild
    set PATH=C:/dev/MyVbox/kBuild/bin/win.x86;%PATH%
    set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio 10.0/Common7/IDE;
    set PATH=%PATH%;C:/PROGRA~1/MICROS~2.0/VC/bin;
    set PATH=%PATH%;C:\dev\MyVbox/tools/win.x86/bin;

Build Driver on windows with nmake

In order to run static analysis for driver, we have to build driver with nmake.

  1. Open a shell and enter source code directory, then run cscript configure.vbs --nmake. this will copy related source file to out/nmake/xpdm and generated

  2. Then open DDK Build environment shell, e.g. Windows XP X86 Free Build Environment. go to out\nmake\xpdm directory, then enter nmake

Build on Linux

View Comments