From: Jack Lange Date: Wed, 23 Jul 2008 03:48:31 +0000 (+0000) Subject: added decoder support to makefile X-Git-Tag: vmmhack1-ramdisk-boot-iso-puppy~49 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=dd37e2c1fabd6d6856c7a2cdbd2f3f73fb034393 added decoder support to makefile --- diff --git a/palacios/build/Makefile b/palacios/build/Makefile index 34a145d..5e6f18d 100644 --- a/palacios/build/Makefile +++ b/palacios/build/Makefile @@ -1,6 +1,6 @@ # Makefile for GeekOS kernel, userspace, and tools # Copyright (c) 2004,2005 David H. Hovemeyer -# $Revision: 1.52 $ +# $Revision: 1.53 $ # This is free software. You are permitted to use, # redistribute, and modify it as specified in the file "COPYING". @@ -77,16 +77,6 @@ DEBUG_SECTIONS := $(DEBUG_SECTIONS) -DDEBUG_NVRAM endif - -# -# XED=1 means that libxed will be included -# -# and VMM_XED is one -# -# and make world will build an empty boot package -# -XED=1 - ifeq ($(DEBUG),1) JRLDEBUG= -DSERIAL_PRINT_DEBUG=1 -DSERIAL_PRINT_DEBUG_LEVEL=10 -DSERIAL_PRINT=1 -DVMM_DEBUG=1 -DVMM_INFO=1 -DVMM_TRACE=1 $(DEBUG_SECTIONS) @@ -94,18 +84,25 @@ else JRLDEBUG= -DSERIAL_PRINT_DEBUG=0 -DSERIAL_PRINT_DEBUG_LEVEL=999999 -DSERIAL_PRINT=0 -DVMM_DEBUG=0 -DVMM_INFO=0 -DVMM_TRACE=0 endif -ifeq ($(XED),1) - LEIXED = -DVMM_XED=1 -else - LEIXED = -DVMM_XED=0 -endif - -LEIFLAGS = $(LEIXED) # +# DECODER is the decoder that will be used +# currently we only support xed # -#Peter's compile flags -PADFLAGS = +DECODER=XED + +DECODER_FLAGS= +DECODER_SRCS= +DECODER_LIBS= + +ifeq ($(DECODER),XED) +DECODER_SRCS := vmm_xed.c +DECODER_FLAGS := -L../lib/xed +DECODER_LIBS := -lxed +else +# This is an error +endif + # # This is wrong for current cygwin - no changes needed @@ -188,10 +185,11 @@ VMM_ASM_OBJS := $(VMM_ASM_SRCS:%.asm=palacios/%.o) VMM_C_SRCS := vm_guest.c \ svm.c svm_handler.c vmm.c vmm_util.c vmm_ctrl_regs.c \ vmcb.c vmm_mem.c vmm_paging.c vmm_io.c vmm_debug.c svm_io.c \ - vmm_intr.c vmm_time.c\ + vmm_intr.c vmm_time.c \ vmm_shadow_paging.c vm_guest_mem.c \ vm_dev.c vmm_dev_mgr.c vmm_decoder.c \ - svm_halt.c svm_pause.c vmm_config.c + svm_halt.c svm_pause.c vmm_config.c \ + $(DECODER_SRCS) #\ # vmx.c vmcs_gen.c vmcs.c @@ -199,17 +197,17 @@ VMM_C_OBJS := $(VMM_C_SRCS:%.c=palacios/%.o) VMM_OBJS := $(VMM_C_OBJS) $(VMM_ASM_OBJS) + + + DEVICE_C_SRCS := generic.c keyboard.c nvram.c timer.c simple_pic.c 8259a.c 8254.c serial.c DEVICE_C_OBJS := $(DEVICE_C_SRCS:%.c=devices/%.o) DEVICE_OBJS := $(DEVICE_C_OBJS) -V3LIBS := +V3LIBS := $(DECODER_LIBS) -ifeq ($(XED),1) - V3LIBS := $(V3LIBS) -L../lib/xed -lxed -endif # ---------------------------------------------------------------------- @@ -277,14 +275,14 @@ FD_SECTORS_PER_TRACK := $(PERL) $(PROJECT_ROOT)/scripts/numsecs_per_track # ---------------------------------------------------------------------- # Flags used for all C source files -GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(JRLDEBUG) $(PADFLAGS) $(LEIFLAGS) -fPIC +GENERAL_OPTS := -O -Wall $(EXTRA_C_OPTS) $(VMM_FLAGS) -fPIC CC_GENERAL_OPTS := $(GENERAL_OPTS) -Werror # Flags used for kernel C source files CC_KERNEL_OPTS := -g -DGEEKOS -I$(PROJECT_ROOT)/include # Flags used for VMM C source files -CC_VMM_OPTS := -g -I$(PROJECT_ROOT)/include -D__V3VEE__ -D__V3_32BIT__ +CC_VMM_OPTS := -g -I$(PROJECT_ROOT)/include -D__V3VEE__ -D__V3_32BIT__ $(DECODER_FLAGS) $(JRLDEBUG) # Flags used for VMM C ASM files NASM_VMM_OPTS := -I$(PROJECT_ROOT)/src/palacios/ -f elf $(EXTRA_NASM_OPTS) @@ -419,7 +417,8 @@ geekos/kernel.bin : geekos/kernel.exe # The kernel executable and symbol map. geekos/kernel.exe : $(KERNEL_OBJS) $(COMMON_C_OBJS) $(VMM_OBJS) $(DEVICE_OBJS) vm_kernel $(TARGET_LD) -o geekos/kernel.exe -Ttext $(KERNEL_BASE_ADDR) -e $(KERNEL_ENTRY) \ - $(KERNEL_OBJS) $(COMMON_C_OBJS) $(VMM_OBJS) $(DEVICE_OBJS) $(V3LIBS) -b binary vm_kernel + $(DECODER_FLAGS) \ + $(KERNEL_OBJS) $(COMMON_C_OBJS) $(VMM_OBJS) $(DEVICE_OBJS) $(V3LIBS) -b binary vm_kernel $(TARGET_NM) geekos/kernel.exe > geekos/kernel.syms diff --git a/palacios/src/geekos/vm.c b/palacios/src/geekos/vm.c index 6da9844..a46bc76 100644 --- a/palacios/src/geekos/vm.c +++ b/palacios/src/geekos/vm.c @@ -10,12 +10,6 @@ - -//test decoder -//#include - -extern int parse(); - #define SPEAKER_PORT 0x61 static inline void VM_Out_Byte(ushort_t port, uchar_t value) @@ -217,12 +211,6 @@ int RunVMM(struct Boot_Info * bootInfo) { Init_V3(&os_hooks, &vmm_ops); - - //test decoder - PrintBoth("testing decoder\n"); - parse(); - PrintBoth("testing decoder done\n"); - extern char _binary_vm_kernel_start; PrintBoth(" Guest Load Addr: 0x%x\n", &_binary_vm_kernel_start); diff --git a/palacios/src/palacios/vmm_xed.c b/palacios/src/palacios/vmm_xed.c index 8dce816..9a05797 100644 --- a/palacios/src/palacios/vmm_xed.c +++ b/palacios/src/palacios/vmm_xed.c @@ -1,8 +1,10 @@ +#include #include #include + int v3_decode(struct guest_info * info, addr_t instr_ptr, struct x86_instr * instr) { xed_state_t dstate;