diff --git a/chapter2/Makefile b/chapter2/Makefile
index 7f6f9e8..f845d00 100644
--- a/chapter2/Makefile
+++ b/chapter2/Makefile
@@ -1,15 +1,19 @@
-CPPFLAGS += -I../xen/xen/include/public
-LDFLAGS += -nostdlib -T example.lds
-CFLAGS += -std=c99
-ASFLAGS = -D__ASSEMBLY__
+XEN_SRC = ../../src/xen-4.2.1
+CPPFLAGS += -I$(XEN_SRC)/xen/include/public
+LDFLAGS += -m elf_i386 -nostdlib -T example.lds
+CFLAGS += -m32 -std=c99
+ASFLAGS = -m32 -D__ASSEMBLY__
-.PHONY: all
+.PHONY: all clean run
all: testkernel
testkernel: bootstrap.x86_32.o kernel.o
- $(CC) $(LDFLAGS) $^ -o testkernel
+ $(LD) $(LDFLAGS) $^ -o testkernel
clean:
rm -f *.o
rm -f testkernel
+
+run: testkernel
+ sudo xm create -c domain_config
diff --git a/chapter2/bootstrap.x86_32.S b/chapter2/bootstrap.x86_32.S
index 710479c..e716170 100644
--- a/chapter2/bootstrap.x86_32.S
+++ b/chapter2/bootstrap.x86_32.S
@@ -7,7 +7,7 @@
.ascii ",VIRT_BASE=0x0"
.ascii ",ELF_PADDR_OFFSET=0x0"
.ascii ",HYPERCALL_PAGE=0x2"
- .ascii ",PAE=no"
+ .ascii ",PAE=yes"
.ascii ",LOADER=generic"
.byte 0
.text
diff --git a/chapter2/domain_config b/chapter2/domain_config
index 226388b..bf8edd5 100644
--- a/chapter2/domain_config
+++ b/chapter2/domain_config
@@ -7,7 +7,8 @@
#parameters for the domain on the xm command line.
#====================================================
#Kernel image file.
-kernel = "testkernel"
+cur_dir = os.getcwd()
+kernel = cur_dir + "/testkernel"
# Initial memory allocation (in megabytes) for the new
# domain.
memory = 32