Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


*** empty log message ***
[palacios.git] / palacios / build / Makefile
index 941b8bd..7587e29 100644 (file)
@@ -1,6 +1,6 @@
 # Makefile for GeekOS kernel, userspace, and tools
 # Copyright (c) 2004,2005 David H. Hovemeyer <daveho@cs.umd.edu>
-# $Revision: 1.1 $
+# $Revision: 1.12 $
 
 # This is free software.  You are permitted to use,
 # redistribute, and modify it as specified in the file "COPYING".
@@ -23,7 +23,7 @@
 
 # THESE MUST MATCH WHAT IS DEFINED IN defs.h and defs.asm exactly
 # MUST BE INTEGRAL NUMBER OF PAGES
-TOP_OF_MEM := 0x40000000
+TOP_OF_MEM := 0x30000000
 VM_SIZE    := 0x20000000
 VM_START   := 0x0
 
@@ -31,7 +31,7 @@ VM_START   := 0x0
 # THE KERNEL, SETUP, BOOTPACKAGE MUST BE SMALLER THAN THIS
 # MUST BE INTEGRAL NUMBER OF PAGES
 # define 
-MAX_VMM := 0x60000
+MAX_VMM := 0x160000
 
 # Base address of kernel
 #
@@ -54,7 +54,7 @@ VPATH := $(PROJECT_ROOT)/src
 
 #when -DNDEBUG is set the kassert functions are disabled
 #JRLDEBUG=-DNDEBUG
-JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=1000 -DSERIAL_PRINT=1
+JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=10 -DSERIAL_PRINT=1
 
 #
 #
@@ -85,25 +85,28 @@ VMM_SIZES = ../include/geekos/vmm_sizes.h
 # List of targets to build by default.
 # These targets encompass everything needed to boot
 # and run GeekOS.
-ALL_TARGETS := fd.img  rombios vgabios vmxassist
+ALL_TARGETS := fd.img vm_kernel
 
 
 # Kernel source files
 KERNEL_C_SRCS := idt.c int.c trap.c irq.c io.c \
+        blockdev.c ide.c \
        keyboard.c screen.c timer.c \
        mem.c crc32.c \
        gdt.c tss.c segment.c \
        bget.c malloc.c \
        synch.c kthread.c \
        serial.c  reboot.c \
-        paging.c vmx.c vmcs_gen.c vmcs.c\
+        paging.c vmx.c vmcs_gen.c vmcs.c \
+        svm.c vmm.c vmm_util.c vmm_stubs.c \
+       debug.c\
        main.c
 
 # Kernel object files built from C source files
 KERNEL_C_OBJS := $(KERNEL_C_SRCS:%.c=geekos/%.o)
 
 # Kernel assembly files
-KERNEL_ASM_SRCS := lowlevel.asm vmx_lowlevel.asm
+KERNEL_ASM_SRCS := lowlevel.asm vmx_lowlevel.asm svm_lowlevel.asm
 
 KERNEL_GAS_SRCS := testvm.s
 
@@ -135,10 +138,12 @@ COMMON_C_OBJS := $(COMMON_C_SRCS:%.c=common/%.o)
 # ----------------------------------------------------------------------
 
 # Uncomment if cross compiling
-#TARGET_CC_PREFIX := i386-elf-
+TARGET_CC_PREFIX :=  $(PROJECT_ROOT)/../devtools/i386/bin/i386-elf-
+#TARGET_CC_PREFIX :=  i386-elf-
 
 # Target C compiler.  gcc 2.95.2 or later should work.
 TARGET_CC := $(TARGET_CC_PREFIX)gcc
+#TARGET_CC := $(TARGET_CC_PREFIX)gcc34 -m32
 
 # Host C compiler.  This is used to compile programs to execute on
 # the host platform, not the target (x86) platform.  On x86/ELF
@@ -147,7 +152,7 @@ TARGET_CC := $(TARGET_CC_PREFIX)gcc
 HOST_CC := gcc
 
 # Target linker.  GNU ld is probably to only one that will work.
-TARGET_LD := $(TARGET_CC_PREFIX)ld
+TARGET_LD := $(TARGET_CC_PREFIX)ld -melf_i386
 
 # Target archiver
 TARGET_AR := $(TARGET_CC_PREFIX)ar
@@ -162,9 +167,10 @@ TARGET_NM := $(TARGET_CC_PREFIX)nm
 TARGET_OBJCOPY := $(TARGET_CC_PREFIX)objcopy
 
 # Nasm (http://nasm.sourceforge.net)
-NASM := /usr/local/nasm-vmx/bin/nasm
+NASM := $(PROJECT_ROOT)/../devtools/bin/nasm
+#NASM := /opt/vmm-tools/bin/nasm
 
-AS = as
+AS = as --32
 
 # Tool to build PFAT filesystem images.
 BUILDFAT := tools/builtFat.exe
@@ -251,16 +257,15 @@ geekos/test: geekos/test.o geekos/vmcs.o geekos/vmx_lowlevel.o
        $(CC) geekos/test.o geekos/vmcs.o geekos/vmx_lowlevel.o  -o geekos/test
 
 # Standard floppy image - just boots the kernel
-fd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin rombios vgabios vmxassist
+fd.img : geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin vm_kernel
        cat geekos/fd_boot.bin geekos/setup.bin geekos/kernel.bin > _temp
        $(PAD) _temp 512
-# Note - second copy of rombios is intentional 
-       cat _temp rombios vgabios vmxassist rombios > $@
+       cat _temp vm_kernel > $@
 
 # make ready to boot over PXE
 pxe:   fd.img
-       cp fd.img /tftpboot/geekos.img
-       $(PAD) /tftpboot/geekos.img 1474560
+       cp fd.img /tftpboot/vmm.img
+       $(PAD) /tftpboot/vmm.img 1474560
 
 
 pxe-discovery-pdinda:  fd.img
@@ -280,14 +285,12 @@ pxe-discovery-bjp600:     fd.img
 
 
 # Floppy boot sector (first stage boot loader).
-geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geekos/fd_boot.asm rombios vgabios vmxassist
+geekos/fd_boot.bin : geekos/setup.bin geekos/kernel.bin $(PROJECT_ROOT)/src/geekos/fd_boot.asm vm_kernel
        $(NASM) -f bin \
                -I$(PROJECT_ROOT)/src/geekos/ \
                -DNUM_SETUP_SECTORS=`$(NUMSECS) geekos/setup.bin` \
                -DNUM_KERN_SECTORS=`$(NUMSECS) geekos/kernel.bin` \
-               -DNUM_BIOS_SECTORS=`$(NUMSECS) rombios` \
-               -DNUM_VGA_BIOS_SECTORS=`$(NUMSECS) vgabios` \
-               -DNUM_VMXASSIST_SECTORS=`$(NUMSECS) vmxassist` \
+               -DNUM_VM_KERNEL_SECTORS=`$(NUMSECS) vm_kernel` \
                $(PROJECT_ROOT)/src/geekos/fd_boot.asm \
                -o $@
 
@@ -318,20 +321,15 @@ generate_sizes: force
        echo "#ifndef __vmm_sizes" > $(VMM_SIZES)
        echo "#define __vmm_sizes" >> $(VMM_SIZES)
        echo "#define KERNEL_LOAD_ADDRESS " $(KERNEL_BASE_ADDR)  >> $(VMM_SIZES) 
-       echo "#define KERNEL_SETUP_LENGTH (" `$(NUMSECS) geekos/setup.bin` "*512)" >> $(VMM_SIZES) 
-       echo "#define KERNEL_CORE_LENGTH (" `$(NUMSECS)  geekos/kernel.bin` "*512)" >> $(VMM_SIZES) 
+
        echo "#define KERNEL_START (KERNEL_LOAD_ADDRESS)" >> $(VMM_SIZES)
+       echo "#define KERNEL_CORE_LENGTH (" `$(NUMSECS) geekos/kernel.bin` "*512)" >> $(VMM_SIZES) 
        echo "#define KERNEL_END (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH-1)" >> $(VMM_SIZES)
-       echo "#define BIOS_LENGTH (" `$(NUMSECS) rombios` "*512)" >> $(VMM_SIZES) 
-       echo "#define VGA_BIOS_LENGTH (" `$(NUMSECS) vgabios` "*512)" >> $(VMM_SIZES) 
-       echo "#define VMXASSIST_LENGTH (" `$(NUMSECS) vmxassist` "*512)" >> $(VMM_SIZES) 
-       echo "#define BIOS_START (KERNEL_LOAD_ADDRESS+KERNEL_CORE_LENGTH)" >> $(VMM_SIZES) 
-       echo "#define VGA_BIOS_START (BIOS_START+BIOS_LENGTH)" >> $(VMM_SIZES)
-       echo "#define VMXASSIST_START (VGA_BIOS_START+VGA_BIOS_LENGTH)" >> $(VMM_SIZES)
-       echo "//Note this is a second copy of the rom bios for debug" >> $(VMM_SIZES)
-       echo "#define BIOS2_START (VMXASSIST_START+VMXASSIST_LENGTH)" >> $(VMM_SIZES)
-       echo "#define VM_BOOT_PACKAGE_START (BIOS_START) " >> $(VMM_SIZES)
-       echo "#define VM_BOOT_PACKAGE_END  (BIOS2_START+BIOS_LENGTH-1) " >> $(VMM_SIZES)
+
+       echo "#define VM_KERNEL_LENGTH (" `$(NUMSECS) vm_kernel` "*512)" >> $(VMM_SIZES)
+       echo "#define VM_KERNEL_START (KERNEL_LOAD_ADDRESS + KERNEL_CORE_LENGTH)" >> $(VMM_SIZES)
+       echo "#define VM_BOOT_PACKAGE_START (VM_KERNEL_START) " >> $(VMM_SIZES)
+       echo "#define VM_BOOT_PACKAGE_END  (VM_KERNEL_START+VM_KERNEL_LENGTH-1) " >> $(VMM_SIZES)
        echo "#endif" >> $(VMM_SIZES)
 
 make_show_sizes: generate_sizes ../src/geekos/show_sizes.c
@@ -347,31 +345,13 @@ get_kernel_size: make_show_sizes
 force:
 
 
-rombios: force
-       (cd ../src/vmboot/rombios; make)
-       cp ../src/vmboot/rombios/BIOS-bochs-latest rombios
-       $(PAD) rombios 512
-       @echo "Rom bios lives at f000:0000 and is" `$(NUMSECS) rombios` "sectors long"
-
-
-vgabios: force
-       (cd ../src/vmboot/vgabios;  make)
-       cp ../src/vmboot/vgabios/vgabios.bin vgabios
-       $(PAD) vgabios 512
-       @echo "Vga bios lives at c000:0000 and is" `$(NUMSECS) vgabios` "sectors long"
+vm_kernel: force
+       $(PAD) vm_kernel 512
+       @echo "VM kernel lives at 0x100000 and is" `$(NUMSECS) vm_kernel` "sectors long"
 
-vmxassist: force
-       (cd ../src/vmboot/vmxassist; make)
-       cp ../src/vmboot/vmxassist/vmxassist.bin vmxassist
-       $(PAD) vmxassist 512
-       @echo "vmxassist lives at d000:0000 and is" `$(NUMSECS) vmxassist` "sectors long"
 
 # Clean build directories of generated files
 clean :
-       rm -f rombios vgabios vmxassist
-       (cd ../src/vmboot/rombios; make clean)
-       (cd ../src/vmboot/vgabios;  make clean)
-       (cd ../src/vmboot/vmxassist; make clean)
        for d in geekos common libc user tools; do \
                (cd $$d && rm -f *); \
        done