Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. diff --git a/chapter2/Makefile b/chapter2/Makefile
  2. index 7f6f9e8..f845d00 100644
  3. --- a/chapter2/Makefile
  4. +++ b/chapter2/Makefile
  5. @@ -1,15 +1,19 @@
  6. -CPPFLAGS += -I../xen/xen/include/public
  7. -LDFLAGS  += -nostdlib -T example.lds
  8. -CFLAGS   += -std=c99
  9. -ASFLAGS   = -D__ASSEMBLY__
  10. +XEN_SRC = ../../src/xen-4.2.1
  11. +CPPFLAGS += -I$(XEN_SRC)/xen/include/public
  12. +LDFLAGS  += -m elf_i386 -nostdlib -T example.lds
  13. +CFLAGS   += -m32 -std=c99
  14. +ASFLAGS   = -m32 -D__ASSEMBLY__
  15.  
  16. -.PHONY: all
  17. +.PHONY: all clean run
  18.  
  19.  all: testkernel
  20.  
  21.  testkernel: bootstrap.x86_32.o kernel.o
  22. -   $(CC) $(LDFLAGS) $^ -o testkernel
  23. +   $(LD) $(LDFLAGS) $^ -o testkernel
  24.  
  25.  clean:
  26.     rm -f *.o
  27.     rm -f testkernel
  28. +
  29. +run: testkernel
  30. +   sudo xm create -c domain_config
  31. diff --git a/chapter2/bootstrap.x86_32.S b/chapter2/bootstrap.x86_32.S
  32. index 710479c..e716170 100644
  33. --- a/chapter2/bootstrap.x86_32.S
  34. +++ b/chapter2/bootstrap.x86_32.S
  35. @@ -7,7 +7,7 @@
  36.     .ascii  ",VIRT_BASE=0x0"
  37.     .ascii  ",ELF_PADDR_OFFSET=0x0"
  38.     .ascii  ",HYPERCALL_PAGE=0x2"
  39. -   .ascii  ",PAE=no"
  40. +   .ascii  ",PAE=yes"
  41.     .ascii  ",LOADER=generic"
  42.     .byte   0
  43.  .text
  44. diff --git a/chapter2/domain_config b/chapter2/domain_config
  45. index 226388b..bf8edd5 100644
  46. --- a/chapter2/domain_config
  47. +++ b/chapter2/domain_config
  48. @@ -7,7 +7,8 @@
  49.  #parameters for the domain on the xm command line.
  50.  #====================================================
  51.  #Kernel image file.
  52. -kernel = "testkernel"
  53. +cur_dir = os.getcwd()
  54. +kernel = cur_dir + "/testkernel"
  55.  # Initial memory allocation (in megabytes) for the new
  56.  # domain.
  57.  memory = 32