VirtualMonitor
Build on windows Build on Linux
Build on windows
Windows build prerequisites
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. http://www.microsoft.com/express/downloads
Microsoft .NET Framework 4 http://www.microsoft.com/en-us/download/details.aspx?id=17718
Windows Platform SDK v7.1 http://www.microsoft.com/en-us/download/details.aspx?id=8279
Windows Driver Development Kit (WDK) v7.1. http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11800
Install Microsoft Visual C++ 2010 Service Pack 1 http://www.microsoft.com/downloads/en/details.aspx?FamilyID=689655b4-c55d-4f9b-9665-2c547e637b70
Install Microsoft Visual Studio 2010 Service Pack 1. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5
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. http://sourceforge.net/projects/libjpeg-turbo/files
Windows build
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
Change to the root directory of the sources and enter our build shell environment: env.bat
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.
Change configure.vbs to make it can detect your Visual C++ correctly.
Do not run cscript configure.vbs, and manully edit AutoConfig.kmk and env.bat. here is the example of AutoConfig.kmk and evn.bat:
AutoConfig.kmk
# -*- 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_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100)
PATH_SDK_WINPSDK71 := C:/PROGRA~1/MICROS~3/Windows/v7.1
VBOX_WINPSDK := WINPSDK71
VBOX_WITH_OPEN_WATCOM :=
PATH_SDK_LIBJPEG := C:/libjpeg-turbo64
evn.bat
@echo off
rem
rem Environment setup script generated by cscript configure.vbs --with-libjpeg=c:\libjpeg-turbo64
rem
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.
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 source.inc
Then open DDK Build environment shell, e.g. Windows XP X86 Free Build Environment. go to out\nmake\xpdm directory, then enter nmake