help
This enables the necesary options to compile Palacios with Kitten
-config LINUX
- bool "Linux 2.6"
+config LINUX_BUILTIN
+ bool "OLD Linux (Built in) -- to be deprecated"
select BUILT_IN_STDLIB
select BUILT_IN_ATOI
select FILE
This enables the necessary options to compile Palacios with Linux 2.6
Currently, this is in development, and only 2.6.32 is verified to work
+
+config LINUX
+ bool "Linux Module"
+ select BUILT_IN_STDLIB
+ select BUILT_IN_ATOI
+ select FILE
+ help
+ This enables the necessary options to compile Palacios as a Linux module
+
+
+config LINUX_KERN
+ depends on LINUX
+ string "Linux Kernel Source directory"
+ default "/usr/src/linux"
+ help
+ This is the directory containing the linux source for the kernel module to be built
+
config MINIX
bool "MINIX 3"
help
CPPFLAGS := $(V3_INCLUDE) -D__V3VEE__
-CFLAGS := -fno-stack-protector -Wall -Werror -fPIC -mno-red-zone -fno-common
-#-fPIC
+CFLAGS := -fno-stack-protector -Wall -Werror -mno-red-zone -fno-common
+
+
+
#-ffreestanding
devices-y := palacios/src/devices/
modules-y := modules/
+
+
+
ifeq ($(dot-config),1)
# In this section, we need .config
palacios/include/autoconf.h: ;
endif
+
+ifdef CONFIG_LINUX
+DEFAULT_EXTRA_TARGETS=linux_module
+else
DEFAULT_EXTRA_TARGETS=
+endif
# The all: target is the default when no target is given on the
# command line.
all: palacios $(DEFAULT_EXTRA_TARGETS)
+ifdef CONFIG_LINUX
+CFLAGS += -mcmodel=kernel
+else
+CFLAGS += -fPIC
+endif
+
ifdef CONFIG_FRAME_POINTER
CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
devices-y := $(patsubst %/, %/built-in.o, $(devices-y))
libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
modules-y := $(patsubst %/, %/built-in.o, $(modules-y))
+
#core-y := $(patsubst %/, %/lib.a, $(core-y))
#devices-y := $(patsubst %/, %/lib.a, $(devices-y))
palacios := $(core-y) $(devices-y) $(libs-y) $(modules-y)
-# Rule to link palacios - also used during CONFIG_KALLSYMS
+
+# Rule to link palacios - also used during CONFIG_CONFIGKALLSYMS
# May be overridden by /Makefile.$(ARCH)
quiet_cmd_palacios__ ?= AR $@
cmd_palacios__ ?= $(AR) rcs $@ $^
palacios: libv3vee.a
+
+linux_module/v3vee.ko:
+ cd linux_module/ && make CONFIG_LINUX_KERN=$(CONFIG_LINUX_KERN)
+ cp linux_module/v3vee.ko v3vee.ko
+
+
+linux_module: linux_module/v3vee.ko
+
palacios.asm: palacios
$(OBJDUMP) --disassemble $< > $@
@find . $(RCS_FIND_IGNORE) \
\( -name 'lib' \) -prune -o \
\( -name '*.[oas]' -o -name '.*.cmd' \
- -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
+ -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' -o -name '*.ko' \) \
-type f -print | xargs rm -f
# mrproper - Delete all generated files, including .config
-KERNELDIR := ../../linux-2.6.32.y/
-CONFIG_PALACIOS_PATH := /home/jarusl/palacios
+LDFLAGS += --whole-archive --script=$(PWD)/link.cmd
+EXTRA_CFLAGS += -I$(PWD)/../palacios/include/ -DMODULE=1 -D__KERNEL__=1
-v3vee-objs := palacios.o palacios-dev.o palacios-vm.o palacios-file.o palacios-stream.o palacios-console.o palacios-mm.o palacios-serial.o palacios-queue.o palacios-ringbuffer.o
+v3vee-objs:= palacios.o \
+ palacios-dev.o \
+ palacios-vm.o \
+ palacios-file.o \
+ palacios-stream.o \
+ palacios-console.o \
+ palacios-mm.o \
+ palacios-serial.o \
+ palacios-queue.o \
+ palacios-ringbuffer.o
+
#palacios-socket.o
#palacios-vnet.o palacios-packet.o
-v3vee-objs += ../../palacios/libv3vee.a
+v3vee-objs += ../libv3vee.a
obj-m := v3vee.o
-LDFLAGS = --whole-archive --script=$(PWD)/link.cmd
-
-
-EXTRA_CFLAGS := -I$(CONFIG_PALACIOS_PATH)/palacios/include/ -DMODULE=1 -D__KERNEL__=1
-
-
all:
- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+ $(MAKE) -C $(CONFIG_LINUX_KERN) M=$(PWD) modules
-clean:
- $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
-install:
- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install /sbin/ -ae
+clean:
+ $(MAKE) -C $(CONFIG_LINUX_KERN) M=$(PWD) clean