#
-#TCPSTACK, uIP is used currently
+#uIP, ON -- used, OFF -- not used
#
-TCPSTACK=UIP
-
+UIP=OFF
+#
+#LWIP, ON -- used, OFF -- not used
+#
+LWIP=OFF
#
#endif
+ifeq ($(PROFILE_VMM),1)
+ EXTRA_C_OPTS:= -DPROFILE_VMM
+endif
# ----------------------------------------------------------------------
COMMON_C_OBJS := $(COMMON_C_SRCS:%.c=common/%.o)
-
-
V3_LD_FLAGS := -L./palacios/
#V3_LIBS := -lxed -lv3vee
V3_LIBS := ./palacios/libxed.a ./palacios/libv3vee.a ./palacios/libxed.a ./palacios/libv3vee.a
+V3_OBJS := ./palacios/libxed.a ./palacios/libv3vee.a ./palacios/vm_kernel
+ifeq ($(UIP),ON)
+ UIP_C_SRCS := psock.c timer.c uip_arp.c uip.c uip-fw.c uiplib.c uip-neighbor.c uip-split.c resolv.c
+ UIP_C_OBJS := $(UIP_C_SRCS:%.c=net/%.o)
+else
+ UIP_C_SRCS :=
+ UIP_C_OBJS :=
+endif
+ifeq ($(LWIP),ON)
-TCPSTACK_C_SRCS := psock.c timer.c uip_arp.c uip.c uip-fw.c uiplib.c uip-neighbor.c uip-split.c resolv.c
-
-TCPSTACK_C_OBJS := $(TCPSTACK_C_SRCS:%.c=net/%.o)
-
-TCPSTACK_OBJS := $(TCPSTACK_C_OBJS)
+ LWIP_OBJS := lwip
+ CC_LWIP_OPTS := -I$(PROJECT_ROOT)/include/lwip -I$(PROJECT_ROOT)/include/lwip/ipv4 -I$(PROJECT_ROOT)/include/libc -DLWIP_DEBUG
+else
+ LWIP_OBJS :=
+ CC_LWIP_OPTS :=
+endif
+TCPSTACK_OBJS := $(UIP_C_OBJS) $(LWIP_OBJS)
# ----------------------------------------------------------------------
# Compilation of kernel C source files
geekos/%.o : geekos/%.c
- $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_KERNEL_OPTS) $< -o geekos/$*.o
+ $(TARGET_CC) -c $(CC_GENERAL_OPTS) $(CC_KERNEL_OPTS) $(CC_LWIP_OPTS) $< -o geekos/$*.o
# Compilation of kernel assembly source files
all : $(ALL_TARGETS)
+lwip:
+ (cd ../src/lwip/build; make clean; make)
+
+
#geekos/vmx_lowlevel.o: $(PROJECT_ROOT)/src/geekos/vmx_lowlevel.asm
# $(NASM) -O99 \
# -f elf \
$(PAD) $@ 512
# The kernel executable and symbol map.
-geekos/kernel.exe : $(KERNEL_OBJS) $(COMMON_C_OBJS) $(TCPSTACK_OBJS)
+geekos/kernel.exe : $(KERNEL_OBJS) $(COMMON_C_OBJS) $(TCPSTACK_OBJS) $(V3_OBJS)
$(TARGET_LD) -o geekos/kernel.exe -Ttext $(KERNEL_BASE_ADDR) -e $(KERNEL_ENTRY) \
$(V3_LD_FLAGS) \
$(KERNEL_OBJS) $(COMMON_C_OBJS) $(TCPSTACK_OBJS) $(V3_LIBS) -b binary ./palacios/vm_kernel