win-pvdrivers

changeset 347:f31625adca93

add docs on mingw building and modify makefile for private build of w32api link libraries
author Andy Grover <andy.grover@oracle.com>
date Tue Jul 01 15:21:35 2008 -0700 (2008-07-01)
parents a3e81bb18d0b
children 6c1d86fffcd2
files doc/BUILDING_mingw.txt xenpci/makefile.mingw
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/doc/BUILDING_mingw.txt	Tue Jul 01 15:21:35 2008 -0700
     1.3 @@ -0,0 +1,32 @@
     1.4 +This driver is buildable using MinGW32. This may be preferable due to licensing
     1.5 +reasons to using the Microsoft WDK/DDK.
     1.6 +
     1.7 +These instructions are for building the driver on a Linux Ubuntu system, using
     1.8 +the mingw32msvc cross-compiler.
     1.9 +
    1.10 +1. sudo apt-get install mingw mingw-binutils mingw-runtime
    1.11 +
    1.12 +2. mingw-runtime headers need to be modified. Download the latest w32api-src.tar.gz
    1.13 +   package from mingw.sf.net.
    1.14 +
    1.15 +3. Untar, then edit lib/ddk/ntoskrnl.def. Remove ";" from line ~545, which says
    1.16 +   "KeNumberProcessors DATA".
    1.17 +
    1.18 +4. Type: "./configure i586-mingw32-msvc;make"
    1.19 +
    1.20 +2. Use Mercurial and type:
    1.21 +   "hg clone http://xenbits.xensource.com/ext/win-pvdrivers.hg"
    1.22 +
    1.23 +4. Change to the win-pvdrivers.hg/xenpci dir.
    1.24 +
    1.25 +5. Modify the W32API_PATH at the top of makefile.mingw to point to the lib/ddk
    1.26 +   directory of the w32api package compiled above.
    1.27 +
    1.28 +6. Type: "make -f makefile.mingw"
    1.29 +
    1.30 +7. Building the shutdown monitor is not supported (maybe using Mono is an option
    1.31 +   here?)
    1.32 +
    1.33 +8. This is still an extremely alpha build method, so this will give you a
    1.34 +   .sys file but you're on your own for the rest!
    1.35 +
     2.1 --- a/xenpci/makefile.mingw	Tue Jul 01 15:19:43 2008 -0700
     2.2 +++ b/xenpci/makefile.mingw	Tue Jul 01 15:21:35 2008 -0700
     2.3 @@ -1,6 +1,8 @@
     2.4 -CFLAGS = -Wall -I/usr/i586-mingw32msvc/include/ddk/ -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas
     2.5 +W32API_PATH=/home/agrover/temp/w32api-3.11/lib/ddk
     2.6  
     2.7 -xenpci.sys: xenpci.c xenbus.c evtchn.c gnttbl.c xenpci_fdo.c
     2.8 +CFLAGS = -Wall -L$(W32API_PATH) -I../mingw/inc -I/usr/i586-mingw32msvc/include/ddk/ -I../common/include -I../common/include/public -Wno-multichar -Wno-unknown-pragmas
     2.9 +
    2.10 +xenpci.sys: xenpci.c xenbus.c evtchn.c gnttbl.c xenpci_fdo.c xenpci_pdo.c memory.c mingw_extras.c
    2.11  	i586-mingw32msvc-gcc $(CFLAGS) -o $@ -s -shared -Wl,--entry,_load@8 -nostdlib $^ -lntoskrnl -lhal
    2.12  
    2.13  test.exe: test.c kexec.h