diff --git a/repos/base-fiasco/doc/fiasco.txt b/repos/base-fiasco/doc/fiasco.txt index 441503d820..d4429958f0 100644 --- a/repos/base-fiasco/doc/fiasco.txt +++ b/repos/base-fiasco/doc/fiasco.txt @@ -59,12 +59,12 @@ with 'fiasco_x86' as argument: From within the new , the kernel can be compiled via -! make kernel +! make kernel/fiasco -When using Genode's run mechanism, there is no need to explicitly -build the kernel. The run environment (see 'base-fiasco/run/env') -takes care of it. So you can simple execute run scripts from within -the build directory, for example: +When using Genode's run mechanism, there is no need to explicitly build the +kernel. The run environment (see 'tool/run/boot_dir/fiasco') takes care of it. +So you can simple execute run scripts from within the build directory, for +example: ! make run/demo @@ -115,22 +115,5 @@ interest for using Genode: is used to create a single binary image containing all boot-time OS components. -To build all components under '3rd/fiasco' after extracting the -archive, issue the following commands: - -! mkdir -! make -C 3rd/fiasco BUILD_DIR=/3rd build - -The specified '' must be the absolute path to the -directory, which will contain the build directories for the third party -software and the Genode build directory. After the build, your compound -build directory contains the following subdirectories: - -:'fiasco_x86': - - All generated files and the final binary of Fiasco reside here. - -:'l4env': - - L4 environment binaries and header files. - +Those components are implicitly built by the Genode build system when +issuing 'make kernel/fiasco'. diff --git a/repos/base-fiasco/etc/fiasco.conf b/repos/base-fiasco/etc/fiasco.conf deleted file mode 100644 index 589873dca7..0000000000 --- a/repos/base-fiasco/etc/fiasco.conf +++ /dev/null @@ -1,11 +0,0 @@ -# -# Fiasco-specific default configuration options -# - -# -# Directory, where to search for L4 headers -# -# When using this file as template for a customized -# '/etc/fiasco.conf'. -# -#L4_DIR = $(HOME)/src/l4build.x86 diff --git a/repos/base-fiasco/etc/specs.conf b/repos/base-fiasco/etc/specs.conf index 91f1b03352..eafd6189f4 100644 --- a/repos/base-fiasco/etc/specs.conf +++ b/repos/base-fiasco/etc/specs.conf @@ -1,15 +1 @@ -# -# Description of build platform -# - -# -# To build the Fiasco-specific Genode binaries, -# use one of the the following config options. -# -SPECS = genode fiasco_x86 - -# -# To build for the ARM integrator platform, -# use the following SPECS value. -# -#SPECS = genode platform_integrator fiasco_arm +SPECS += genode fiasco x86_32 vesa pci ps2 framebuffer diff --git a/repos/base-fiasco/lib/import/import-syscall-fiasco.mk b/repos/base-fiasco/lib/import/import-syscall-fiasco.mk new file mode 100644 index 0000000000..527b5cdca3 --- /dev/null +++ b/repos/base-fiasco/lib/import/import-syscall-fiasco.mk @@ -0,0 +1,6 @@ +L4_SRC_DIR := $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot + +INC_DIR += $(LIB_CACHE_DIR)/syscall-fiasco/include/x86/l4v2 \ + $(LIB_CACHE_DIR)/syscall-fiasco/include/x86 \ + $(LIB_CACHE_DIR)/syscall-fiasco/include \ + $(LIB_CACHE_DIR)/syscall-fiasco/include/l4v2 diff --git a/repos/base-fiasco/lib/mk/base-fiasco-common.mk b/repos/base-fiasco/lib/mk/base-fiasco-common.mk index 9d03d7f921..7d0a6a5fb3 100644 --- a/repos/base-fiasco/lib/mk/base-fiasco-common.mk +++ b/repos/base-fiasco/lib/mk/base-fiasco-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += startup +LIBS += startup-fiasco syscall-fiasco SRC_CC += capability.cc capability_raw.cc SRC_CC += signal_submit.cc diff --git a/repos/base-fiasco/lib/mk/base-fiasco.mk b/repos/base-fiasco/lib/mk/base-fiasco.mk index eec5dc9399..dfca0008ef 100644 --- a/repos/base-fiasco/lib/mk/base-fiasco.mk +++ b/repos/base-fiasco/lib/mk/base-fiasco.mk @@ -1,5 +1,7 @@ include $(BASE_DIR)/lib/mk/base.inc +LIBS += syscall-fiasco + SRC_CC += thread_start.cc SRC_CC += cache.cc SRC_CC += capability_space.cc diff --git a/repos/base-fiasco/lib/mk/core.inc b/repos/base-fiasco/lib/mk/core-fiasco.inc similarity index 98% rename from repos/base-fiasco/lib/mk/core.inc rename to repos/base-fiasco/lib/mk/core-fiasco.inc index 94a3716d94..8aead27b8d 100644 --- a/repos/base-fiasco/lib/mk/core.inc +++ b/repos/base-fiasco/lib/mk/core-fiasco.inc @@ -42,7 +42,7 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(REP_DIR)/src/include \ $(BASE_DIR)/src/include -LIBS += base-fiasco-common +LIBS += base-fiasco-common syscall-fiasco include $(GEN_CORE_DIR)/version.inc diff --git a/repos/base-fiasco/lib/mk/kernel-fiasco.inc b/repos/base-fiasco/lib/mk/kernel-fiasco.inc new file mode 100644 index 0000000000..cca65d55ea --- /dev/null +++ b/repos/base-fiasco/lib/mk/kernel-fiasco.inc @@ -0,0 +1,53 @@ +L4_SRC_DIR = $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot + +FIASCO_BUILD_DIR = $(shell pwd)/build +FIASCO = $(FIASCO_BUILD_DIR)/fiasco +FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco + +KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco] /" + +$(FIASCO_BUILD_DIR): + $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + $(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ \ + $(KERNEL_BUILD_OUTPUT_FILTER) + $(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out + $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + $(VERBOSE_DIR) -C $@ oldconfig \ + $(KERNEL_BUILD_OUTPUT_FILTER) + $(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out + +$(FIASCO): $(FIASCO_BUILD_DIR) + $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + $(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) \ + $(KERNEL_BUILD_OUTPUT_FILTER) + +# +# Sigma0 and bootstrap are provided as L4 packages +# +# We build them within the L4 build directory created by the 'syscall-fiasco' +# library. +# + +LIBS += syscall-fiasco + +PKGS = l4sys/lib \ + uclibc/lib/uclibc \ + uclibc/lib/include \ + crtx \ + l4util/lib \ + cxx \ + sigma0/server \ + bootstrap + +L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-fiasco + +include $(REP_DIR)/lib/mk/l4_pkg.inc + +# +# Execute the rules in this file only at the second build stage when we know +# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'. +# +ifeq ($(called_from_lib_mk),yes) +all: $(FIASCO) +endif + diff --git a/repos/base-fiasco/mk/l4_pkg.mk b/repos/base-fiasco/lib/mk/l4_pkg.inc similarity index 67% rename from repos/base-fiasco/mk/l4_pkg.mk rename to repos/base-fiasco/lib/mk/l4_pkg.inc index 7ba396c703..0039d718e5 100644 --- a/repos/base-fiasco/mk/l4_pkg.mk +++ b/repos/base-fiasco/lib/mk/l4_pkg.inc @@ -8,8 +8,6 @@ # the target # -LIBS += platform - ifeq ($(filter-out $(SPECS),x86_32),) L4_BUILD_ARCH := x86 endif @@ -19,19 +17,29 @@ ifeq ($(filter-out $(SPECS),arm),) endif ifeq ($(L4_BUILD_ARCH),) -all: l4_build_arch_undefined - $(VERBOSE)$(ECHO) "Error: L4_BUILD_ARCH undefined, architecture not supported" - $(VERBOSE)false +$(error L4_BUILD_ARCH undefined, architecture not supported) endif -L4_PKG_DIR = $(L4_SRC_DIR)/l4/pkg -PKG_TAGS = $(addsuffix .tag,$(PKGS)) +ifndef L4_BUILD_DIR +$(error L4_BUILD_DIR undefined) +endif + +L4_PKG_DIR = $(L4_SRC_DIR)/l4/pkg +PKG_TAGS = $(addsuffix .tag,$(PKGS)) + +BUILD_OUTPUT_FILTER = 2>&1 | sed "s~^~ [$*] ~" ifeq ($(VERBOSE),) L4_VERBOSE = V=1 endif -$(TARGET): $(PKG_TAGS) +# +# Execute the rules in this file only at the second build stage when we know +# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'. +# +ifeq ($(called_from_lib_mk),yes) +all: $(PKG_TAGS) +endif # # We preserve the order of processing 'l4/pkg/' directories because of @@ -52,17 +60,7 @@ $(TARGET): $(PKG_TAGS) -C $(L4_PKG_DIR)/$* \ CC="$(CROSS_DEV_PREFIX)gcc" \ CXX="$(CROSS_DEV_PREFIX)g++" \ - LD="$(CROSS_DEV_PREFIX)ld" + LD="$(CROSS_DEV_PREFIX)ld" \ + $(BUILD_OUTPUT_FILTER) $(VERBOSE)mkdir -p $(dir $@) && touch $@ -clean cleanall: clean_tags - -# if (pseudo) target is named after a directory, remove the whole subtree -clean_prg_objects: clean_dir_named_as_target - -clean_dir_named_as_target: - $(VERBOSE)(test -d $(TARGET) && rm -rf $(TARGET)) || true - -clean_tags: - $(VERBOSE)rm -f $(PKG_TAGS) - diff --git a/repos/base-fiasco/lib/mk/l4v2_support.mk b/repos/base-fiasco/lib/mk/l4v2_support.mk deleted file mode 100644 index 8bda913f9a..0000000000 --- a/repos/base-fiasco/lib/mk/l4v2_support.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Build L4env base libraries, needed by sigma0 and bootstrap - - -# ignore stage one, visit the L4 build system at second build stage -ifeq ($(called_from_lib_mk),yes) - -# packages in 'l4/pkg/' -PKGS = l4sys/lib \ - uclibc/lib/uclibc \ - uclibc/lib/include \ - crtx \ - l4util/lib \ - cxx - -include $(REP_DIR)/mk/l4_pkg.mk -all: $(PKG_TAGS) - -endif diff --git a/repos/base-fiasco/lib/mk/platform.inc b/repos/base-fiasco/lib/mk/platform.inc deleted file mode 100644 index cb0f90e8b1..0000000000 --- a/repos/base-fiasco/lib/mk/platform.inc +++ /dev/null @@ -1,56 +0,0 @@ -# -# Create prerequisites for building Genode for Fiasco -# -# Prior building Genode programs for Fiasco, the kernel bindings must be -# generated. This is done by building a minimalistic subset of the original -# userland that comes with Fiasco. -# - -# -# Execute the rules in this file only at the second build stage when we know -# about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'. -# -ifeq ($(called_from_lib_mk),yes) - -# -# Sanity checks -# -ifeq ($(L4_BUILD_DIR),$(BUILD_BASE_DIR)/l4) -all: $(L4_SRC_DIR) - -$(L4_SRC_DIR): - $(VERBOSE)$(ECHO) "--> Please, execute './tool/ports/prepare_port fiasco' in $(GENODE_DIR)" - $(VERBOSE)$(ECHO) "--> before compiling Genode apps for Fiasco." - $(VERBOSE)exit 1 -endif - -# -# Create L4 build directory -# -$(BUILD_BASE_DIR)/l4/.Makeconf.bid.old: - $(VERBOSE)mkdir -p $(dir $@) - $(VERBOSE)cp $(L4_CONFIG) $(@:.old=) - $(VERBOSE_MK) MAKEFLAGS= make $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \ - O=$(BUILD_BASE_DIR)/l4 SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" oldconfig - -$(BUILD_BASE_DIR)/l4/pkg/uclibc/lib/uclibc: - $(VERBOSE)mkdir -p $(BUILD_BASE_DIR)/l4/pkg/uclibc/lib/uclibc - $(VERBOSE)tar cf - --exclude .svn -C $(L4_SRC_DIR)/../uclibc ARCH-all ARCH-x86 \ - | tar xf - -C $(BUILD_BASE_DIR)/l4/pkg/uclibc/lib/uclibc - -PKGS = input/include \ - drivers/uart/include \ - l4sys/include \ - l4util/include \ - libc_support/include \ - libsigma0/include - -include $(REP_DIR)/mk/l4_pkg.mk - -all: $(PKG_TAGS) - -$(PKG_TAGS): $(BUILD_BASE_DIR)/l4/.Makeconf.bid.old -$(PKG_TAGS): $(BUILD_BASE_DIR)/l4/pkg/uclibc/lib/uclibc - -endif - diff --git a/repos/base-fiasco/lib/mk/spec/x86/core.mk b/repos/base-fiasco/lib/mk/spec/x86_32/core-fiasco.mk similarity index 87% rename from repos/base-fiasco/lib/mk/spec/x86/core.mk rename to repos/base-fiasco/lib/mk/spec/x86_32/core-fiasco.mk index dac89e98b9..7a7faeb157 100644 --- a/repos/base-fiasco/lib/mk/spec/x86/core.mk +++ b/repos/base-fiasco/lib/mk/spec/x86_32/core-fiasco.mk @@ -1,4 +1,4 @@ -include $(REP_DIR)/lib/mk/core.inc +include $(REP_DIR)/lib/mk/core-fiasco.inc LIBS += base-fiasco-common SRC_CC += platform_x86.cc diff --git a/repos/base-fiasco/lib/mk/spec/x86_32/kernel-fiasco.mk b/repos/base-fiasco/lib/mk/spec/x86_32/kernel-fiasco.mk new file mode 100644 index 0000000000..f3e748a8c3 --- /dev/null +++ b/repos/base-fiasco/lib/mk/spec/x86_32/kernel-fiasco.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG = $(REP_DIR)/config/kernel-config.x86 + +include $(REP_DIR)/lib/mk/kernel-fiasco.inc diff --git a/repos/base-fiasco/lib/mk/spec/x86_32/startup-fiasco.mk b/repos/base-fiasco/lib/mk/spec/x86_32/startup-fiasco.mk new file mode 100644 index 0000000000..4047666023 --- /dev/null +++ b/repos/base-fiasco/lib/mk/spec/x86_32/startup-fiasco.mk @@ -0,0 +1,3 @@ +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc + +LIBS += syscall-fiasco diff --git a/repos/base-fiasco/lib/mk/spec/x86/platform.mk b/repos/base-fiasco/lib/mk/spec/x86_32/syscall-fiasco.mk similarity index 74% rename from repos/base-fiasco/lib/mk/spec/x86/platform.mk rename to repos/base-fiasco/lib/mk/spec/x86_32/syscall-fiasco.mk index e53cdd8d18..590bbffb0a 100644 --- a/repos/base-fiasco/lib/mk/spec/x86/platform.mk +++ b/repos/base-fiasco/lib/mk/spec/x86_32/syscall-fiasco.mk @@ -3,4 +3,4 @@ # L4_CONFIG = $(REP_DIR)/config/l4env-config.x86 -include $(REP_DIR)/lib/mk/platform.inc +include $(REP_DIR)/lib/mk/syscall-fiasco.inc diff --git a/repos/base-fiasco/lib/mk/syscall-fiasco.inc b/repos/base-fiasco/lib/mk/syscall-fiasco.inc new file mode 100644 index 0000000000..646d1e95ea --- /dev/null +++ b/repos/base-fiasco/lib/mk/syscall-fiasco.inc @@ -0,0 +1,38 @@ +# +# Create prerequisites for building Genode for Fiasco +# +# Prior building Genode programs for Fiasco, the kernel bindings must be +# generated. This is done by building a minimalistic subset of the original +# userland that comes with Fiasco. +# + +L4_SRC_DIR = $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot +L4_BUILD_DIR := $(shell pwd) + +# +# Create L4 build directory +# +.Makeconf.bid.old: + $(VERBOSE)mkdir -p $(dir $@) + $(VERBOSE)cp $(L4_CONFIG) $(@:.old=) + $(VERBOSE_MK) MAKEFLAGS= make $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \ + O=$(L4_BUILD_DIR) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" oldconfig \ + 2>&1 | sed "s/^/ [l4build] /" + $(VERBOSE)touch $@ + +pkg/uclibc/lib/uclibc: + $(VERBOSE)mkdir -p pkg/uclibc/lib/uclibc + $(VERBOSE)tar cf - --exclude .svn -C $(L4_SRC_DIR)/../uclibc ARCH-all ARCH-x86 \ + | tar xf - -C pkg/uclibc/lib/uclibc + +PKGS = input/include \ + drivers/uart/include \ + l4sys/include \ + l4util/include \ + libc_support/include \ + libsigma0/include + +include $(REP_DIR)/lib/mk/l4_pkg.inc + +$(PKG_TAGS): .Makeconf.bid.old +$(PKG_TAGS): pkg/uclibc/lib/uclibc diff --git a/repos/base-fiasco/mk/spec/fiasco.mk b/repos/base-fiasco/mk/spec/fiasco.mk deleted file mode 100644 index d90220c793..0000000000 --- a/repos/base-fiasco/mk/spec/fiasco.mk +++ /dev/null @@ -1,25 +0,0 @@ -# -# Specifics for the l4v2 kernel API -# - -# -# Read default and builddir-specific config files -# -# In these config files, we find the definition of L4_DIR -# --include $(call select_from_repositories,etc/fiasco.conf) --include $(BUILD_BASE_DIR)/etc/fiasco.conf - -L4_BUILD_DIR := $(BUILD_BASE_DIR)/l4 -L4_SRC_DIR := $(call select_from_ports,fiasco)/src/kernel/fiasco/fiasco/snapshot - -# -# L4/sys headers -# -L4_INC_DIR += $(L4_BUILD_DIR)/include \ - $(L4_BUILD_DIR)/include/l4v2 - -clean_contrib: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/l4 - -cleanall: clean_contrib diff --git a/repos/base-fiasco/mk/spec/fiasco_x86.mk b/repos/base-fiasco/mk/spec/fiasco_x86.mk deleted file mode 100644 index 012c516483..0000000000 --- a/repos/base-fiasco/mk/spec/fiasco_x86.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -# Specifics for Fiasco L4v2 on x86 -# - -SPECS += x86_32 fiasco -SPECS += pci ps2 vesa framebuffer - -# -# x86-specific L4v2/sys headers -# -L4_INC_DIR += $(L4_BUILD_DIR)/include/x86/l4v2 \ - $(L4_BUILD_DIR)/include/x86 - -# -# Also include less-specific configuration last -# -include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/fiasco.mk) - -INC_DIR += $(L4_INC_DIR) diff --git a/repos/base-fiasco/src/bootstrap/target.mk b/repos/base-fiasco/src/bootstrap/target.mk deleted file mode 100644 index e2a41b44f2..0000000000 --- a/repos/base-fiasco/src/bootstrap/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = bootstrap -PKGS = bootstrap -LIBS = l4v2_support - -include $(REP_DIR)/mk/l4_pkg.mk diff --git a/repos/base-fiasco/src/core/fiasco/target.mk b/repos/base-fiasco/src/core/fiasco/target.mk new file mode 100644 index 0000000000..a40a66a83c --- /dev/null +++ b/repos/base-fiasco/src/core/fiasco/target.mk @@ -0,0 +1,3 @@ +LIBS = core-fiasco + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-fiasco/src/kernel/fiasco/target.mk b/repos/base-fiasco/src/kernel/fiasco/target.mk new file mode 100644 index 0000000000..6f2e194c5c --- /dev/null +++ b/repos/base-fiasco/src/kernel/fiasco/target.mk @@ -0,0 +1,18 @@ +TARGET = kernel-fiasco +LIBS = kernel-fiasco + +$(TARGET): sigma0 bootstrap kernel + +L4_BUILD_DIR = $(LIB_CACHE_DIR)/syscall-fiasco + +kernel: + $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/kernel-fiasco/build/fiasco $@ + +sigma0: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/l4v2/sigma0 + +bootstrap: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/bootstrap + +clean cleanall: + $(VERBOSE)rm -f kernel sigma0 bootstrap diff --git a/repos/base-fiasco/src/kernel/spec/x86/target.mk b/repos/base-fiasco/src/kernel/spec/x86/target.mk deleted file mode 100644 index 7e5a59d431..0000000000 --- a/repos/base-fiasco/src/kernel/spec/x86/target.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES = x86 32bit -KERNEL_CONFIG = $(REP_DIR)/config/kernel-config.x86 - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-fiasco/src/kernel/target.inc b/repos/base-fiasco/src/kernel/target.inc deleted file mode 100644 index e536962b84..0000000000 --- a/repos/base-fiasco/src/kernel/target.inc +++ /dev/null @@ -1,22 +0,0 @@ -TARGET = fiasco -REQUIRES += fiasco -FIASCO_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/$(TARGET) -FIASCO = $(FIASCO_BUILD_DIR)/fiasco -FIASCO_SRC = $(L4_SRC_DIR)/kernel/fiasco - -$(TARGET): $(FIASCO) - -$(FIASCO_BUILD_DIR): - $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ - $(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ - $(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out - $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ - $(VERBOSE_DIR) -C $@ oldconfig - -$(FIASCO): $(FIASCO_BUILD_DIR) - $(VERBOSE_MK) MAKEFLAGS= $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ - $(VERBOSE_DIR) -C $(FIASCO_BUILD_DIR) - $(VERBOSE)ln -sf $@ $(BUILD_BASE_DIR)/bin/$(TARGET) - -clean cleanall: - $(VERBOSE)rm -rf $(FIASCO_BUILD_DIR) diff --git a/repos/base-fiasco/src/sigma0/target.mk b/repos/base-fiasco/src/sigma0/target.mk deleted file mode 100644 index b9c6271d9f..0000000000 --- a/repos/base-fiasco/src/sigma0/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = sigma0 -PKGS = sigma0/server -LIBS = l4v2_support - -include $(REP_DIR)/mk/l4_pkg.mk diff --git a/repos/base-foc/doc/foc.txt b/repos/base-foc/doc/foc.txt index 7b6a3de8a2..ee2a810e87 100644 --- a/repos/base-foc/doc/foc.txt +++ b/repos/base-foc/doc/foc.txt @@ -111,26 +111,6 @@ to download the Genode project webpage via the 'wget' tool within the L4Linux environment. If all wents fine the run-script completes successfully. -Integration of Fiasco.OC with Genode -#################################### - -If you don't want the Genode build system to build the Fiasco.OC kernel for -you, but you want to provide your own version, you have to state in the -'etc/foc.conf' file within your build directory, where to find it: - -! L4_BUILD_DIR = -! KERNEL = - -The first variable states where to find the kernel bindings (the L4RE build -directory), the second one states where your kernel binary can be found. -After adding these variable to the file, you have to do a full cleanup -in your build directory to ensure, that the right bindings are used: - -! make cleanall - -From now on, run-scripts will use your provided kernel. - - Further Information ################### diff --git a/repos/base-foc/etc/foc.conf b/repos/base-foc/etc/foc.conf deleted file mode 100644 index 46c90d33e8..0000000000 --- a/repos/base-foc/etc/foc.conf +++ /dev/null @@ -1,20 +0,0 @@ -# -# Fiasco.OC-specific default configuration options -# - -# -# Directory, where to search for L4 headers -# -# When using this file as template for a customized -# '/etc/kernel.conf'. -# -#L4_BUILD_DIR = $(HOME)/src/l4build.x86 - -# -# Path to the Fiasco.OC kernel -# -# When using this file as template for a customized -# '/etc/kernel.conf'. -# -#KERNEL = $(HOME)/src/fiasco-build.x86/fiasco - diff --git a/repos/base-foc/etc/specs.conf b/repos/base-foc/etc/specs.conf index 81779dc151..b78640192d 100644 --- a/repos/base-foc/etc/specs.conf +++ b/repos/base-foc/etc/specs.conf @@ -1,8 +1 @@ -# -# Description of build platform -# - -# -# By default, build Fiasco.OC binaries for ia32. -# -SPECS ?= genode foc_x86_32 +SPECS += genode foc diff --git a/repos/base-foc/lib/import/import-syscall-foc.mk b/repos/base-foc/lib/import/import-syscall-foc.mk new file mode 100644 index 0000000000..cc9512c1c8 --- /dev/null +++ b/repos/base-foc/lib/import/import-syscall-foc.mk @@ -0,0 +1,23 @@ +L4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-foc/include + +ifeq ($(filter-out $(SPECS),x86_32),) + INC_DIR += $(L4_INCLUDE_DIR)/x86/l4f $(L4_INCLUDE_DIR)/x86 +endif # 32bit + +ifeq ($(filter-out $(SPECS),x86_64),) + INC_DIR += $(L4_INCLUDE_DIR)/amd64/l4f $(L4_INCLUDE_DIR)/amd64 +endif # 64bit + +ifeq ($(filter-out $(SPECS),arm),) + INC_DIR += $(L4_INCLUDE_DIR)/arm/l4f $(L4_INCLUDE_DIR)/arm + CC_OPT += -DARCH_arm +endif # ARM + +INC_DIR += $(L4_INCLUDE_DIR)/l4f $(L4_INCLUDE_DIR) +CC_OPT += -DCONFIG_L4_CALL_SYSCALLS + +# +# Use 'regparm=0' call instead of an inline function, when accessing +# the utcb. This is needed to stay compatible with L4linux +# +CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 diff --git a/repos/base-foc/lib/mk/base-foc-common.inc b/repos/base-foc/lib/mk/base-foc-common.inc index bc07de1c69..2310431345 100644 --- a/repos/base-foc/lib/mk/base-foc-common.inc +++ b/repos/base-foc/lib/mk/base-foc-common.inc @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += syscall startup +LIBS += syscall-foc startup-foc SRC_CC += spin_lock.cc cap_map.cc SRC_CC += signal_submit.cc diff --git a/repos/base-foc/lib/mk/base-foc.inc b/repos/base-foc/lib/mk/base-foc.inc index f7ad3ffbaa..621adba16d 100644 --- a/repos/base-foc/lib/mk/base-foc.inc +++ b/repos/base-foc/lib/mk/base-foc.inc @@ -1,5 +1,6 @@ include $(BASE_DIR)/lib/mk/base.inc -LIBS += base-foc-common +LIBS += base-foc-common syscall-foc + SRC_CC += cap_map_remove.cc cap_alloc.cc SRC_CC += thread_start.cc diff --git a/repos/base-foc/lib/mk/core.inc b/repos/base-foc/lib/mk/core-foc.inc similarity index 98% rename from repos/base-foc/lib/mk/core.inc rename to repos/base-foc/lib/mk/core-foc.inc index a21216817d..e125bd3de2 100644 --- a/repos/base-foc/lib/mk/core.inc +++ b/repos/base-foc/lib/mk/core-foc.inc @@ -1,8 +1,6 @@ -REQUIRES += foc - GEN_CORE_DIR = $(BASE_DIR)/src/core -LIBS += base-foc-common +LIBS += base-foc-common syscall-foc SRC_CC += stack_area.cc \ core_log.cc \ diff --git a/repos/base-foc/lib/mk/kernel-foc.inc b/repos/base-foc/lib/mk/kernel-foc.inc new file mode 100644 index 0000000000..420c4186dc --- /dev/null +++ b/repos/base-foc/lib/mk/kernel-foc.inc @@ -0,0 +1,47 @@ +FOC_BUILD_DIR = $(shell pwd)/build +FOC = $(FOC_BUILD_DIR)/foc +FOC_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco + +KERNEL_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [fiasco.oc] /" + +$(FOC_BUILD_DIR): + $(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + $(VERBOSE_DIR) -C $(FOC_SRC) BUILDDIR=$@ \ + $(KERNEL_BUILD_OUTPUT_FILTER) + $(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out + +$(FOC): $(FOC_BUILD_DIR) + $(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + CC="$(CC)" CXX="$(CXX)" \ + $(VERBOSE_DIR) -C $(FOC_BUILD_DIR) \ + $(KERNEL_BUILD_OUTPUT_FILTER) + $(VERBOSE)touch $@ + +# +# Sigma0 and bootstrap are provided as L4 packages +# +# We build them within the L4 build directory created by the 'syscall-fiasco' +# library. +# + +LIBS += syscall-foc + +PKGS := uclibc-headers \ + uclibc-minimal \ + l4util \ + cxx \ + sigma0 \ + drivers-frst/include drivers-frst/of drivers-frst/uart \ + bootstrap + +L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc/build + +include $(REP_DIR)/lib/mk/l4_pkg.inc + +# +# Execute the rules in this file only at the second build stage when we know +# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'. +# +ifeq ($(called_from_lib_mk),yes) +all: $(FOC) +endif diff --git a/repos/base-foc/mk/l4_pkg.mk b/repos/base-foc/lib/mk/l4_pkg.inc similarity index 66% rename from repos/base-foc/mk/l4_pkg.mk rename to repos/base-foc/lib/mk/l4_pkg.inc index bfa0af13ea..750d6a5d6b 100644 --- a/repos/base-foc/mk/l4_pkg.mk +++ b/repos/base-foc/lib/mk/l4_pkg.inc @@ -8,8 +8,6 @@ # the target # -LIBS += platform - ifeq ($(filter-out $(SPECS),x86_32),) L4_BUILD_ARCH := x86_586 endif @@ -27,17 +25,22 @@ ifeq ($(filter-out $(SPECS),arm_v6),) endif ifeq ($(L4_BUILD_ARCH),) -all: l4_build_arch_undefined - $(VERBOSE)$(ECHO) "Error: L4_BUILD_ARCH undefined, architecture not supported" - $(VERBOSE)false +$(error L4_BUILD_ARCH undefined, architecture not supported) endif -L4_BUILD_DIR = $(BUILD_BASE_DIR)/l4 L4_BUILD_OPT = SYSTEM_TARGET=$(CROSS_DEV_PREFIX) L4_PKG_DIR := $(call select_from_ports,foc)/src/kernel/foc/l4/pkg PKG_TAGS = $(addsuffix .tag,$(PKGS)) -$(TARGET): $(PKG_TAGS) +BUILD_OUTPUT_FILTER = 2>&1 | sed "s~^~ [$*] ~" + +# +# Execute the rules in this file only at the second build stage when we know +# about the complete build settings, e.g., 'CROSS_DEV_PREFIX'. +# +ifeq ($(called_from_lib_mk),yes) +all: $(PKG_TAGS) +endif # # We preserve the order of processing 'l4/pkg/' directories because of @@ -47,17 +50,7 @@ $(TARGET): $(PKG_TAGS) .NOTPARALLEL: $(PKG_TAGS) %.tag: - $(VERBOSE_MK) $(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* "$(L4_BUILD_OPT)" + $(VERBOSE_MK) $(MAKE) $(VERBOSE_DIR) O=$(L4_BUILD_DIR) -C $(L4_PKG_DIR)/$* \ + "$(L4_BUILD_OPT)" $(BUILD_OUTPUT_FILTER) $(VERBOSE)mkdir -p $(dir $@) && touch $@ -clean cleanall: clean_tags - -# if (pseudo) target is named after a directory, remove the whole subtree -clean_prg_objects: clean_dir_named_as_target - -clean_dir_named_as_target: - $(VERBOSE)(test -d $(TARGET) && rm -rf $(TARGET)) || true - -clean_tags: - $(VERBOSE)rm -f $(PKG_TAGS) - diff --git a/repos/base-foc/lib/mk/l4re_support.mk b/repos/base-foc/lib/mk/l4re_support.mk deleted file mode 100644 index 8058093868..0000000000 --- a/repos/base-foc/lib/mk/l4re_support.mk +++ /dev/null @@ -1,14 +0,0 @@ -# -# Build L4re base libraries, needed by sigma0 and bootstrap - - -# ignore stage one, visit the L4 build system at second build stage -ifeq ($(called_from_lib_mk),yes) - -# packages in 'l4/pkg/' -PKGS = uclibc-headers uclibc-minimal l4util cxx - -include $(REP_DIR)/mk/l4_pkg.mk -all: $(PKG_TAGS) - -endif diff --git a/repos/base-foc/lib/mk/platform.inc b/repos/base-foc/lib/mk/platform.inc deleted file mode 100644 index 90a9cd4ea8..0000000000 --- a/repos/base-foc/lib/mk/platform.inc +++ /dev/null @@ -1,59 +0,0 @@ -# -# Create prerequisites for building Genode for Fiasco.OC -# -# Prior building Genode programs for Fiasco.OC, the kernel bindings must be -# generated. This is done by building a minimalistic subset of the original -# userland (L4re) that comes with Fiasco.OC. -# - -# -# We do this also in the first build stage to ensure that the kernel -# port, if missing, is added to the missing-ports list of this stage. -# -FOC_CONTRIB_DIR := $(call select_from_ports,foc)/src/kernel/foc - -# -# Execute the rules in this file only at the second build stage when we know -# about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'. -# -ifeq ($(called_from_lib_mk),yes) - -# -# Create mirror for architecture-specific L4sys header files -# -L4_INC_TARGETS += l4/sys \ - l4f/l4/sys \ - l4/sigma0 \ - l4/vcpu - -all: $(addprefix $(BUILD_BASE_DIR)/include/,$(L4_INC_TARGETS)) - -$(BUILD_BASE_DIR)/include/%: - $(VERBOSE)mkdir -p $(dir $@) - $(VERBOSE)ln -sf $(L4_BUILD_DIR)/include/$* $@ - -# -# Create L4 build directory -# -# Resetting the 'MAKEFLAGS' is important because otherwise, the L4 -# build system will stuble over predefined variables, i.e., 'LIB' -# -$(BUILD_BASE_DIR)/l4/.kconfig: - $(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(FOC_CONTRIB_DIR)/l4 B=$(dir $@) \ - DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \ - VERBOSE="$(VERBOSE)" SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" - -PKGS = ldscripts \ - libgcc-pure \ - l4sys \ - libgcc \ - libsigma0 \ - libvcpu/include - -include $(REP_DIR)/mk/l4_pkg.mk -all: $(PKG_TAGS) - -$(PKG_TAGS): $(BUILD_BASE_DIR)/l4/.kconfig - -endif - diff --git a/repos/base-foc/lib/mk/spec/arm/core.mk b/repos/base-foc/lib/mk/spec/arm/core-foc.mk similarity index 84% rename from repos/base-foc/lib/mk/spec/arm/core.mk rename to repos/base-foc/lib/mk/spec/arm/core-foc.mk index b489cb0bf8..3408f26fbf 100644 --- a/repos/base-foc/lib/mk/spec/arm/core.mk +++ b/repos/base-foc/lib/mk/spec/arm/core-foc.mk @@ -5,6 +5,6 @@ SRC_CC += spec/arm/platform_arm.cc \ # override default stack-area location INC_DIR += $(REP_DIR)/src/include/spec/arm -include $(REP_DIR)/lib/mk/core.inc +include $(REP_DIR)/lib/mk/core-foc.inc vpath platform_services.cc $(GEN_CORE_DIR) diff --git a/repos/base-foc/lib/mk/spec/arm/platform.inc b/repos/base-foc/lib/mk/spec/arm/platform.inc deleted file mode 100644 index d0bb4139fd..0000000000 --- a/repos/base-foc/lib/mk/spec/arm/platform.inc +++ /dev/null @@ -1,8 +0,0 @@ -# -# Create mirror for architecture-specific L4sys header files -# -L4_INC_TARGETS = arm/l4/sys \ - arm/l4f/l4/sys \ - arm/l4/vcpu - -include $(REP_DIR)/lib/mk/platform.inc diff --git a/repos/base-foc/lib/mk/spec/arm/startup-foc.mk b/repos/base-foc/lib/mk/spec/arm/startup-foc.mk new file mode 100644 index 0000000000..0b84feb18e --- /dev/null +++ b/repos/base-foc/lib/mk/spec/arm/startup-foc.mk @@ -0,0 +1,3 @@ +LIBS += syscall-foc + +include $(BASE_DIR)/lib/mk/spec/arm/startup.inc diff --git a/repos/base-foc/lib/mk/spec/arm/syscall-foc.inc b/repos/base-foc/lib/mk/spec/arm/syscall-foc.inc new file mode 100644 index 0000000000..a614913877 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/arm/syscall-foc.inc @@ -0,0 +1,18 @@ +L4_INC_TARGETS = arm/l4/sys \ + arm/l4f/l4/sys \ + arm/l4/vcpu + +CC_OPT += -Iinclude/arm + +include $(REP_DIR)/lib/mk/syscall-foc.inc + +SRC_C += utcb.c +SRC_S += atomic_ops_s.S + +utcb.c: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/utcb.c + +atomic_ops_s.S: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/ARCH-arm/atomic_ops_s.S + +utcb.c atomic_ops_s.S: $(PKG_TAGS) diff --git a/repos/base-foc/lib/mk/spec/arm/syscall.mk b/repos/base-foc/lib/mk/spec/arm/syscall.mk deleted file mode 100644 index ff94d707d9..0000000000 --- a/repos/base-foc/lib/mk/spec/arm/syscall.mk +++ /dev/null @@ -1,5 +0,0 @@ -SRC_C += utcb.c -SRC_S += atomic_ops_s.S - -vpath atomic_ops_s.S $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/ARCH-arm -vpath utcb.c $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src diff --git a/repos/base-foc/lib/mk/spec/arndale/kernel-foc.mk b/repos/base-foc/lib/mk/spec/arndale/kernel-foc.mk new file mode 100644 index 0000000000..c2d0f85ac1 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/arndale/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/arndale.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/arndale/platform.mk b/repos/base-foc/lib/mk/spec/arndale/platform.mk deleted file mode 100644 index 4902c1ce5a..0000000000 --- a/repos/base-foc/lib/mk/spec/arndale/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/arndale.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk b/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk new file mode 100644 index 0000000000..f496abb1b9 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/arndale.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk b/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk new file mode 100644 index 0000000000..373c58ffef --- /dev/null +++ b/repos/base-foc/lib/mk/spec/imx53/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/imx53.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/imx53/platform.mk b/repos/base-foc/lib/mk/spec/imx53/platform.mk deleted file mode 100644 index d16e4660fb..0000000000 --- a/repos/base-foc/lib/mk/spec/imx53/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/imx53.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk b/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk new file mode 100644 index 0000000000..683d2b8f25 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/imx53.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/odroid_x2/kernel-foc.mk b/repos/base-foc/lib/mk/spec/odroid_x2/kernel-foc.mk new file mode 100644 index 0000000000..c9f3707067 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/odroid_x2/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/odroid_x2.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/odroid_x2/platform.mk b/repos/base-foc/lib/mk/spec/odroid_x2/platform.mk deleted file mode 100644 index 37ec97cbfa..0000000000 --- a/repos/base-foc/lib/mk/spec/odroid_x2/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/odroid_x2.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/odroid_x2/syscall-foc.mk b/repos/base-foc/lib/mk/spec/odroid_x2/syscall-foc.mk new file mode 100644 index 0000000000..feab02a721 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/odroid_x2/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/odroid_x2.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/panda/kernel-foc.mk b/repos/base-foc/lib/mk/spec/panda/kernel-foc.mk new file mode 100644 index 0000000000..8c4898ace0 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/panda/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/panda.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/panda/platform.mk b/repos/base-foc/lib/mk/spec/panda/platform.mk deleted file mode 100644 index 0a02bcadda..0000000000 --- a/repos/base-foc/lib/mk/spec/panda/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/panda.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/panda/syscall-foc.mk b/repos/base-foc/lib/mk/spec/panda/syscall-foc.mk new file mode 100644 index 0000000000..ec7ce9de1c --- /dev/null +++ b/repos/base-foc/lib/mk/spec/panda/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/panda.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/pbxa9/kernel-foc.mk b/repos/base-foc/lib/mk/spec/pbxa9/kernel-foc.mk new file mode 100644 index 0000000000..bcc379af79 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/pbxa9/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/pbxa9.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/pbxa9/platform.mk b/repos/base-foc/lib/mk/spec/pbxa9/platform.mk deleted file mode 100644 index f36ad9337c..0000000000 --- a/repos/base-foc/lib/mk/spec/pbxa9/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/pbxa9.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/pbxa9/syscall-foc.mk b/repos/base-foc/lib/mk/spec/pbxa9/syscall-foc.mk new file mode 100644 index 0000000000..46f11ba874 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/pbxa9/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/pbxa9.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/rpi/kernel-foc.mk b/repos/base-foc/lib/mk/spec/rpi/kernel-foc.mk new file mode 100644 index 0000000000..84fd104ddd --- /dev/null +++ b/repos/base-foc/lib/mk/spec/rpi/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/rpi.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/rpi/platform.mk b/repos/base-foc/lib/mk/spec/rpi/platform.mk deleted file mode 100644 index f2cf8f7964..0000000000 --- a/repos/base-foc/lib/mk/spec/rpi/platform.mk +++ /dev/null @@ -1,6 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/rpi.user) - -include $(REP_DIR)/lib/mk/spec/arm/platform.inc diff --git a/repos/base-foc/lib/mk/spec/rpi/syscall-foc.mk b/repos/base-foc/lib/mk/spec/rpi/syscall-foc.mk new file mode 100644 index 0000000000..8d424ec193 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/rpi/syscall-foc.mk @@ -0,0 +1,3 @@ +L4_CONFIG := $(call select_from_repositories,config/rpi.user) + +include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86/core-foc.inc b/repos/base-foc/lib/mk/spec/x86/core-foc.inc new file mode 100644 index 0000000000..d8523ddc9e --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86/core-foc.inc @@ -0,0 +1,10 @@ +SRC_CC += io_port_session_component.cc \ + io_port_session_support.cc \ + spec/x86/ipc_pager.cc \ + spec/x86/platform.cc + +vpath io_port_session_component.cc $(BASE_DIR)/src/core/spec/x86 +vpath io_port_session_support.cc $(BASE_DIR)/src/core/spec/x86 +vpath platform_services.cc $(BASE_DIR)/src/core/spec/x86 + +include $(REP_DIR)/lib/mk/core-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86/core.inc b/repos/base-foc/lib/mk/spec/x86/core.inc deleted file mode 100644 index 50db05df61..0000000000 --- a/repos/base-foc/lib/mk/spec/x86/core.inc +++ /dev/null @@ -1,11 +0,0 @@ -REQUIRES += x86 -SRC_CC += io_port_session_component.cc \ - io_port_session_support.cc \ - spec/x86/ipc_pager.cc \ - spec/x86/platform.cc - -vpath io_port_session_component.cc $(BASE_DIR)/src/core/spec/x86 -vpath io_port_session_support.cc $(BASE_DIR)/src/core/spec/x86 -vpath platform_services.cc $(BASE_DIR)/src/core/spec/x86 - -include $(REP_DIR)/lib/mk/core.inc diff --git a/repos/base-foc/lib/mk/spec/x86/syscall-foc.inc b/repos/base-foc/lib/mk/spec/x86/syscall-foc.inc new file mode 100644 index 0000000000..935d5cf2f6 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86/syscall-foc.inc @@ -0,0 +1,12 @@ +SRC_C += utcb.c +SRC_S += syscalls_direct.S + +include $(REP_DIR)/lib/mk/syscall-foc.inc + +utcb.c: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/utcb.c + +syscalls_direct.S: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/ARCH-x86/syscalls_direct.S + +utcb.c syscalls_direct.S: $(PKG_TAGS) diff --git a/repos/base-foc/lib/mk/spec/x86/syscall.mk b/repos/base-foc/lib/mk/spec/x86/syscall.mk deleted file mode 100644 index 80154535d5..0000000000 --- a/repos/base-foc/lib/mk/spec/x86/syscall.mk +++ /dev/null @@ -1,5 +0,0 @@ -SRC_C += utcb.c -SRC_S += syscalls_direct.S - -vpath syscalls_direct.S $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src/ARCH-x86 -vpath utcb.c $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src diff --git a/repos/base-foc/lib/mk/spec/x86_32/core-foc.mk b/repos/base-foc/lib/mk/spec/x86_32/core-foc.mk new file mode 100644 index 0000000000..4ae3592ae8 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_32/core-foc.mk @@ -0,0 +1,3 @@ +SRC_CC += spec/x86_32/ipc_pager.cc + +include $(REP_DIR)/lib/mk/spec/x86/core-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86_32/core.mk b/repos/base-foc/lib/mk/spec/x86_32/core.mk deleted file mode 100644 index 529c64ce29..0000000000 --- a/repos/base-foc/lib/mk/spec/x86_32/core.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES += foc_x86_32 -SRC_CC += spec/x86_32/ipc_pager.cc - -include $(REP_DIR)/lib/mk/spec/x86/core.inc diff --git a/repos/base-foc/lib/mk/spec/x86_32/kernel-foc.mk b/repos/base-foc/lib/mk/spec/x86_32/kernel-foc.mk new file mode 100644 index 0000000000..7879f0a52c --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_32/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/x86_32.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86_32/platform.mk b/repos/base-foc/lib/mk/spec/x86_32/platform.mk deleted file mode 100644 index 9ef0be0ac7..0000000000 --- a/repos/base-foc/lib/mk/spec/x86_32/platform.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/x86_32.user) - -# -# Create mirror for architecture-specific L4sys header files -# -L4_INC_TARGETS = x86/l4/sys \ - x86/l4f/l4/sys \ - x86/l4/vcpu - -include $(REP_DIR)/lib/mk/platform.inc diff --git a/repos/base-foc/lib/mk/spec/x86_32/startup-foc.mk b/repos/base-foc/lib/mk/spec/x86_32/startup-foc.mk new file mode 100644 index 0000000000..a184e43f65 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_32/startup-foc.mk @@ -0,0 +1,3 @@ +LIBS += syscall-foc + +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc diff --git a/repos/base-foc/lib/mk/spec/x86_32/syscall-foc.mk b/repos/base-foc/lib/mk/spec/x86_32/syscall-foc.mk new file mode 100644 index 0000000000..b21f254917 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_32/syscall-foc.mk @@ -0,0 +1,9 @@ +L4_CONFIG := $(call select_from_repositories,config/x86_32.user) + +L4_INC_TARGETS := x86/l4/sys x86/l4f/l4/sys x86/l4/vcpu + +CC_OPT += -Iinclude/x86 + +include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc + +vpath syscalls_direct.S $(L4_PKG_DIR)/l4sys/lib/src/ARCH-x86 diff --git a/repos/base-foc/lib/mk/spec/x86_64/core-foc.mk b/repos/base-foc/lib/mk/spec/x86_64/core-foc.mk new file mode 100644 index 0000000000..ddf1d298f5 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_64/core-foc.mk @@ -0,0 +1,3 @@ +SRC_CC += spec/x86_64/ipc_pager.cc + +include $(REP_DIR)/lib/mk/spec/x86/core-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86_64/core.mk b/repos/base-foc/lib/mk/spec/x86_64/core.mk deleted file mode 100644 index d730552321..0000000000 --- a/repos/base-foc/lib/mk/spec/x86_64/core.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES += foc_x86_64 -SRC_CC += spec/x86_64/ipc_pager.cc - -include $(REP_DIR)/lib/mk/spec/x86/core.inc diff --git a/repos/base-foc/lib/mk/spec/x86_64/kernel-foc.mk b/repos/base-foc/lib/mk/spec/x86_64/kernel-foc.mk new file mode 100644 index 0000000000..5526af2ac0 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_64/kernel-foc.mk @@ -0,0 +1,3 @@ +KERNEL_CONFIG := $(REP_DIR)/config/x86_64.kernel + +include $(REP_DIR)/lib/mk/kernel-foc.inc diff --git a/repos/base-foc/lib/mk/spec/x86_64/platform.mk b/repos/base-foc/lib/mk/spec/x86_64/platform.mk deleted file mode 100644 index 883be37720..0000000000 --- a/repos/base-foc/lib/mk/spec/x86_64/platform.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -# Configuration for L4 build system (for kernel-bindings, sigma0, bootstrap). -# -L4_CONFIG = $(call select_from_repositories,config/x86_64.user) - -# -# Create mirror for architecture-specific L4sys header files -# -L4_INC_TARGETS = amd64/l4/sys \ - amd64/l4f/l4/sys \ - amd64/l4/vcpu - -include $(REP_DIR)/lib/mk/platform.inc diff --git a/repos/base-foc/lib/mk/spec/x86_64/startup-foc.mk b/repos/base-foc/lib/mk/spec/x86_64/startup-foc.mk new file mode 100644 index 0000000000..74a55e0789 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_64/startup-foc.mk @@ -0,0 +1,3 @@ +LIBS += syscall-foc + +include $(BASE_DIR)/lib/mk/spec/x86_64/startup.inc diff --git a/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk b/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk new file mode 100644 index 0000000000..627dfdc593 --- /dev/null +++ b/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk @@ -0,0 +1,7 @@ +L4_CONFIG := $(call select_from_repositories,config/x86_64.user) + +L4_INC_TARGETS := amd64/l4/sys amd64/l4f/l4/sys amd64/l4/vcpu + +CC_OPT += -Iinclude/amd64 + +include $(REP_DIR)/lib/mk/spec/x86/syscall-foc.inc diff --git a/repos/base-foc/lib/mk/syscall-foc.inc b/repos/base-foc/lib/mk/syscall-foc.inc new file mode 100644 index 0000000000..033bc0b74b --- /dev/null +++ b/repos/base-foc/lib/mk/syscall-foc.inc @@ -0,0 +1,59 @@ +# +# Create prerequisites for building Genode for Fiasco.OC +# +# Prior building Genode programs for Fiasco.OC, the kernel bindings must be +# generated. This is done by building a minimalistic subset of the original +# userland (L4re) that comes with Fiasco.OC. +# + +L4_SRC_DIR := $(call select_from_ports,foc)/src/kernel/foc +L4_BUILD_DIR := $(shell pwd)/build + +# +# Create mirror for architecture-specific L4sys header files +# +L4_INC_TARGETS += l4/sys \ + l4f/l4/sys \ + l4/sigma0 \ + l4/vcpu + +CC_OPT += -Iinclude + +include/%: + $(VERBOSE)mkdir -p $(dir $@) + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/include/$* $@ + +# +# Use 'regparm=0' call instead of an inline function, when accessing +# the utcb. This is needed to stay compatible with L4linux +# +CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 + +# +# Create L4 build directory +# +# Resetting the 'MAKEFLAGS' is important because otherwise, the L4 +# build system will stuble over predefined variables, i.e., 'LIB' +# +$(L4_BUILD_DIR)/.kconfig: + $(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(L4_SRC_DIR)/l4 \ + B=$(L4_BUILD_DIR) DROPSCONF_DEFCONFIG="$(L4_CONFIG)" \ + VERBOSE="$(VERBOSE)" SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ + 2>&1 | sed "s/^/ [l4build] /" + +PKGS := ldscripts \ + libgcc-pure \ + l4sys \ + libgcc \ + libsigma0 \ + libvcpu/include + +include $(REP_DIR)/lib/mk/l4_pkg.inc + +$(PKG_TAGS): $(L4_BUILD_DIR)/.kconfig +$(PKG_TAGS): $(addprefix include/,$(L4_INC_TARGETS)) + +# +# Compile 'syscall-foc.lib.a' not before the 'PKGS' are completely built +# +$(SRC_S) $(SRC_C) : $(PKG_TAGS) diff --git a/repos/base-foc/mk/spec/foc.mk b/repos/base-foc/mk/spec/foc.mk deleted file mode 100644 index 29404f7af6..0000000000 --- a/repos/base-foc/mk/spec/foc.mk +++ /dev/null @@ -1,46 +0,0 @@ -# -# Specifics for the Fiasco.OC kernel API -# - --include $(call select_from_repositories,etc/foc.conf) --include $(BUILD_BASE_DIR)/etc/foc.conf - -# -# L4/sys headers -# -L4_INC_DIR += $(BUILD_BASE_DIR)/include/ -L4F_INC_DIR += $(BUILD_BASE_DIR)/include/l4f - -# -# L4 build directory, if not defined by 'foc.conf', use directory local -# to the Genode build directory. -# -L4_BUILD_DIR ?= $(BUILD_BASE_DIR)/l4 - -# -# Build everything with -fPIC because the Fiasco.OC syscall bindings -# rely on 'ebx' (on x86) being handled with care. Without -fPIC enabled, -# the syscall bindings break. -# -CC_OPT += -fPIC - -# -# Use 'regparm=0' call instead of an inline function, when accessing -# the utcb. This is needed to stay compatible with L4linux -# -CC_OPT += -DL4SYS_USE_UTCB_WRAP=1 - -all: - -# -# Clean rules for removing the side effects of building the platform -# library -# -clean_includes: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/include - -clean_contrib: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/l4 - -cleanall: clean_contrib clean_includes - diff --git a/repos/base-foc/mk/spec/foc_arm.mk b/repos/base-foc/mk/spec/foc_arm.mk index c616e3e97f..f5ae8ffc52 100644 --- a/repos/base-foc/mk/spec/foc_arm.mk +++ b/repos/base-foc/mk/spec/foc_arm.mk @@ -1,27 +1 @@ -# -# Specifics for Fiasco.OC on ARM -# - SPECS += foc - -# -# ARM-specific L4/sys headers -# -L4_INC_DIR = $(BUILD_BASE_DIR)/include/arm -L4F_INC_DIR = $(BUILD_BASE_DIR)/include/arm/l4f - -# -# Defines for L4/sys headers -# -CC_OPT += -DCONFIG_L4_CALL_SYSCALLS -DARCH_arm - -# -# Architecture-specific L4sys header files -# -L4_INC_TARGETS = arm/l4/sys \ - arm/l4f/l4/sys \ - arm/l4/vcpu - -include $(call select_from_repositories,mk/spec/foc.mk) - -INC_DIR += $(L4F_INC_DIR) $(L4_INC_DIR) diff --git a/repos/base-foc/mk/spec/foc_imx53.mk b/repos/base-foc/mk/spec/foc_imx53.mk index 936723a54e..dced50930a 100644 --- a/repos/base-foc/mk/spec/foc_imx53.mk +++ b/repos/base-foc/mk/spec/foc_imx53.mk @@ -1,6 +1,6 @@ SPECS += foc_arm imx53 imx53_qsb -# add repository relative include paths +# add repository-relative include paths REP_INC_DIR += include/spec/imx53_qsb include $(call select_from_repositories,mk/spec/imx53.mk) diff --git a/repos/base-foc/mk/spec/foc_x86_32.mk b/repos/base-foc/mk/spec/foc_x86_32.mk index ae9faba345..920757bce9 100644 --- a/repos/base-foc/mk/spec/foc_x86_32.mk +++ b/repos/base-foc/mk/spec/foc_x86_32.mk @@ -1,20 +1,3 @@ -# -# Specifics for Fiasco.OC on x86 -# +SPECS += x86_32 foc pci ps2 vesa framebuffer -SPECS += x86_32 foc -SPECS += pci ps2 vesa framebuffer - -# -# L4/sys headers -# -L4_INC_DIR = $(BUILD_BASE_DIR)/include/x86 -L4F_INC_DIR = $(BUILD_BASE_DIR)/include/x86/l4f - -# -# Also include less-specific configuration last -# include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/foc.mk) - -INC_DIR += $(L4F_INC_DIR) $(L4_INC_DIR) diff --git a/repos/base-foc/mk/spec/foc_x86_64.mk b/repos/base-foc/mk/spec/foc_x86_64.mk index c9557cdaa2..15560e1616 100644 --- a/repos/base-foc/mk/spec/foc_x86_64.mk +++ b/repos/base-foc/mk/spec/foc_x86_64.mk @@ -1,25 +1,3 @@ -# -# Specifics for Fiasco.OC on x86 64-bit -# +SPECS += x86_64 foc pci ps2 vesa framebuffer -SPECS += x86_64 foc -SPECS += pci ps2 vesa framebuffer - -# -# L4/sys headers -# -L4_INC_DIR = $(BUILD_BASE_DIR)/include/amd64 -L4F_INC_DIR = $(BUILD_BASE_DIR)/include/amd64/l4f - -# -# Compile for 64-bit -# -CC_OPT += -m64 - -# -# Also include less-specific configuration last -# include $(call select_from_repositories,mk/spec/x86_64.mk) -include $(call select_from_repositories,mk/spec/foc.mk) - -INC_DIR += $(L4F_INC_DIR) $(L4_INC_DIR) diff --git a/repos/base-foc/src/bootstrap/target.mk b/repos/base-foc/src/bootstrap/target.mk deleted file mode 100644 index e98501b467..0000000000 --- a/repos/base-foc/src/bootstrap/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = bootstrap -PKGS = drivers-frst/include drivers-frst/of drivers-frst/uart bootstrap -LIBS = l4re_support - -include $(REP_DIR)/mk/l4_pkg.mk diff --git a/repos/base-foc/src/core/foc/target.mk b/repos/base-foc/src/core/foc/target.mk new file mode 100644 index 0000000000..960afad3c4 --- /dev/null +++ b/repos/base-foc/src/core/foc/target.mk @@ -0,0 +1,3 @@ +LIBS = core-foc + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-foc/src/kernel/foc/target.mk b/repos/base-foc/src/kernel/foc/target.mk new file mode 100644 index 0000000000..e529384c8d --- /dev/null +++ b/repos/base-foc/src/kernel/foc/target.mk @@ -0,0 +1,2 @@ +TARGET = kernel-foc +LIBS = kernel-foc diff --git a/repos/base-foc/src/kernel/spec/arndale/target.mk b/repos/base-foc/src/kernel/spec/arndale/target.mk deleted file mode 100644 index 95e80cb51b..0000000000 --- a/repos/base-foc/src/kernel/spec/arndale/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -REQUIRES = arndale -FIASCO_DIR := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco -KERNEL_CONFIG = $(REP_DIR)/config/arndale.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/imx53/target.mk b/repos/base-foc/src/kernel/spec/imx53/target.mk deleted file mode 100644 index e0f0818983..0000000000 --- a/repos/base-foc/src/kernel/spec/imx53/target.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES = imx53 -KERNEL_CONFIG = $(REP_DIR)/config/imx53.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/odroid_x2/target.mk b/repos/base-foc/src/kernel/spec/odroid_x2/target.mk deleted file mode 100644 index bc2e49b8f6..0000000000 --- a/repos/base-foc/src/kernel/spec/odroid_x2/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -REQUIRES = odroid_x2 -FIASCO_DIR := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco -KERNEL_CONFIG = $(REP_DIR)/config/odroid_x2.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/panda/target.mk b/repos/base-foc/src/kernel/spec/panda/target.mk deleted file mode 100644 index 40103a9dc9..0000000000 --- a/repos/base-foc/src/kernel/spec/panda/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -REQUIRES = panda -FIASCO_DIR := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco -KERNEL_CONFIG = $(REP_DIR)/config/panda.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/pbxa9/target.mk b/repos/base-foc/src/kernel/spec/pbxa9/target.mk deleted file mode 100644 index cd1cee9788..0000000000 --- a/repos/base-foc/src/kernel/spec/pbxa9/target.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES = pbxa9 -KERNEL_CONFIG = $(REP_DIR)/config/pbxa9.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/rpi/target.mk b/repos/base-foc/src/kernel/spec/rpi/target.mk deleted file mode 100644 index 049f665fd7..0000000000 --- a/repos/base-foc/src/kernel/spec/rpi/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -REQUIRES = rpi -FIASCO_DIR := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco -KERNEL_CONFIG = $(REP_DIR)/config/rpi.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/x86_32/target.mk b/repos/base-foc/src/kernel/spec/x86_32/target.mk deleted file mode 100644 index 419015f24a..0000000000 --- a/repos/base-foc/src/kernel/spec/x86_32/target.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES = x86 32bit -KERNEL_CONFIG = $(REP_DIR)/config/x86_32.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/spec/x86_64/target.mk b/repos/base-foc/src/kernel/spec/x86_64/target.mk deleted file mode 100644 index 012a1a6bb4..0000000000 --- a/repos/base-foc/src/kernel/spec/x86_64/target.mk +++ /dev/null @@ -1,4 +0,0 @@ -REQUIRES = x86 64bit -KERNEL_CONFIG = $(REP_DIR)/config/x86_64.kernel - --include $(PRG_DIR)/../../target.inc diff --git a/repos/base-foc/src/kernel/target.inc b/repos/base-foc/src/kernel/target.inc deleted file mode 100644 index 1bb0f01147..0000000000 --- a/repos/base-foc/src/kernel/target.inc +++ /dev/null @@ -1,21 +0,0 @@ -TARGET = fiasco.oc -REQUIRES += foc -FOC_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/$(TARGET) -FIASCO = $(FOC_BUILD_DIR)/fiasco -FIASCO_SRC := $(call select_from_ports,foc)/src/kernel/foc/kernel/fiasco - -$(TARGET): $(FIASCO) - -$(FOC_BUILD_DIR): - $(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ - $(VERBOSE_DIR) -C $(FIASCO_SRC) BUILDDIR=$@ - $(VERBOSE)cp $(KERNEL_CONFIG) $@/globalconfig.out - -$(FIASCO): $(FOC_BUILD_DIR) - $(VERBOSE_MK) $(MAKE) SYSTEM_TARGET="$(CROSS_DEV_PREFIX)" \ - CC="$(CC)" CXX="$(CXX)" \ - $(VERBOSE_DIR) -C $(FOC_BUILD_DIR) - $(VERBOSE)ln -sf $@ $(BUILD_BASE_DIR)/bin/$(TARGET) - -clean cleanall: - $(VERBOSE)rm -rf $(FOC_BUILD_DIR) diff --git a/repos/base-foc/src/sigma0/target.mk b/repos/base-foc/src/sigma0/target.mk deleted file mode 100644 index 81726b75ad..0000000000 --- a/repos/base-foc/src/sigma0/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = l4f/sigma0 -PKGS = sigma0 -LIBS = l4re_support - -include $(REP_DIR)/mk/l4_pkg.mk diff --git a/repos/base-foc/src/test/cap_integrity/target.mk b/repos/base-foc/src/test/cap_integrity/target.mk index 8b836382e9..22c2c99ce7 100644 --- a/repos/base-foc/src/test/cap_integrity/target.mk +++ b/repos/base-foc/src/test/cap_integrity/target.mk @@ -2,4 +2,4 @@ REQUIRES = foc TARGET = test-cap_integrity SRC_CC = main.cc INC_DIR += $(REP_DIR)/src/include -LIBS = base +LIBS = base-foc syscall-foc diff --git a/repos/base-hw/lib/import/import-core.mk b/repos/base-hw/lib/import/import-core.mk deleted file mode 100644 index 57cf3fd27b..0000000000 --- a/repos/base-hw/lib/import/import-core.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# \brief Automatically included by targets that depend on the core lib -# \author Martin Stein -# \date 2011-12-16 -# - -# add include paths -INC_DIR += $(REP_DIR)/src/core/include diff --git a/repos/base-hw/lib/mk/base-hw.mk b/repos/base-hw/lib/mk/base-hw.mk index dddbca13bf..9657280da7 100644 --- a/repos/base-hw/lib/mk/base-hw.mk +++ b/repos/base-hw/lib/mk/base-hw.mk @@ -5,4 +5,4 @@ SRC_CC += env.cc SRC_CC += capability.cc SRC_CC += cache.cc -LIBS += startup base-hw-common +LIBS += startup-hw base-hw-common diff --git a/repos/base-hw/lib/mk/core-muen.mk b/repos/base-hw/lib/mk/core-hw-muen.mk similarity index 86% rename from repos/base-hw/lib/mk/core-muen.mk rename to repos/base-hw/lib/mk/core-hw-muen.mk index cf4d32fa7f..b9d6cfdb83 100644 --- a/repos/base-hw/lib/mk/core-muen.mk +++ b/repos/base-hw/lib/mk/core-hw-muen.mk @@ -7,4 +7,4 @@ REQUIRES = x86_64 # add library dependencies -LIBS += core-muen_off +LIBS += core-hw-muen_off diff --git a/repos/base-hw/lib/mk/core-perf_counter.mk b/repos/base-hw/lib/mk/core-hw-perf_counter.mk similarity index 100% rename from repos/base-hw/lib/mk/core-perf_counter.mk rename to repos/base-hw/lib/mk/core-hw-perf_counter.mk diff --git a/repos/base-hw/lib/mk/core-trustzone.inc b/repos/base-hw/lib/mk/core-hw-trustzone.inc similarity index 100% rename from repos/base-hw/lib/mk/core-trustzone.inc rename to repos/base-hw/lib/mk/core-hw-trustzone.inc diff --git a/repos/base-hw/lib/mk/spec/trustzone/core-trustzone.mk b/repos/base-hw/lib/mk/core-hw-trustzone.mk similarity index 85% rename from repos/base-hw/lib/mk/spec/trustzone/core-trustzone.mk rename to repos/base-hw/lib/mk/core-hw-trustzone.mk index 37832ff55a..472e0b21ea 100644 --- a/repos/base-hw/lib/mk/spec/trustzone/core-trustzone.mk +++ b/repos/base-hw/lib/mk/core-hw-trustzone.mk @@ -6,4 +6,4 @@ # # add library dependencies -LIBS += core-trustzone_on +LIBS += core-hw-trustzone_off diff --git a/repos/base-hw/lib/mk/core-trustzone_off.mk b/repos/base-hw/lib/mk/core-hw-trustzone_off.mk similarity index 100% rename from repos/base-hw/lib/mk/core-trustzone_off.mk rename to repos/base-hw/lib/mk/core-hw-trustzone_off.mk diff --git a/repos/base-hw/lib/mk/core.inc b/repos/base-hw/lib/mk/core-hw.inc similarity index 94% rename from repos/base-hw/lib/mk/core.inc rename to repos/base-hw/lib/mk/core-hw.inc index 3670b34b34..35f56c7478 100644 --- a/repos/base-hw/lib/mk/core.inc +++ b/repos/base-hw/lib/mk/core-hw.inc @@ -4,11 +4,7 @@ # \date 2011-12-16 # -# add library dependencies -LIBS += core-perf_counter - -# add library dependencies -LIBS += base-hw-common +LIBS += core-hw-perf_counter base-hw-common # add include paths INC_DIR += $(BASE_DIR)/../base-hw/src/core/include diff --git a/repos/base-hw/lib/mk/core-trustzone.mk b/repos/base-hw/lib/mk/core-trustzone.mk deleted file mode 100644 index 3ec3c938c5..0000000000 --- a/repos/base-hw/lib/mk/core-trustzone.mk +++ /dev/null @@ -1,9 +0,0 @@ -# -# \brief Build config for parts of core that depend on Trustzone status -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-24 -# - -# add library dependencies -LIBS += core-trustzone_off diff --git a/repos/base-hw/lib/mk/spec/arm/core.inc b/repos/base-hw/lib/mk/spec/arm/core-hw.inc similarity index 90% rename from repos/base-hw/lib/mk/spec/arm/core.inc rename to repos/base-hw/lib/mk/spec/arm/core-hw.inc index f9201afe4d..a2c96e2db3 100644 --- a/repos/base-hw/lib/mk/spec/arm/core.inc +++ b/repos/base-hw/lib/mk/spec/arm/core-hw.inc @@ -18,4 +18,4 @@ SRC_S += spec/arm/kernel/crt0.s SRC_S += spec/arm/crt0.s # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/arm/startup-hw.mk b/repos/base-hw/lib/mk/spec/arm/startup-hw.mk new file mode 100644 index 0000000000..6123496d87 --- /dev/null +++ b/repos/base-hw/lib/mk/spec/arm/startup-hw.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/arm/startup.inc diff --git a/repos/base-hw/lib/mk/spec/arm_v6/core-perf_counter_on.mk b/repos/base-hw/lib/mk/spec/arm_v6/core-hw-perf_counter_on.mk similarity index 100% rename from repos/base-hw/lib/mk/spec/arm_v6/core-perf_counter_on.mk rename to repos/base-hw/lib/mk/spec/arm_v6/core-hw-perf_counter_on.mk diff --git a/repos/base-hw/lib/mk/spec/arm_v6/core.inc b/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc similarity index 90% rename from repos/base-hw/lib/mk/spec/arm_v6/core.inc rename to repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc index 0cedb6ddd4..c29b4afcb9 100644 --- a/repos/base-hw/lib/mk/spec/arm_v6/core.inc +++ b/repos/base-hw/lib/mk/spec/arm_v6/core-hw.inc @@ -20,4 +20,4 @@ SRC_CC += kernel/kernel.cc SRC_S += spec/arm_v6/mode_transition.s # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/arm/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/arm/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/arm_v7/core-perf_counter_on.mk b/repos/base-hw/lib/mk/spec/arm_v7/core-hw-perf_counter_on.mk similarity index 100% rename from repos/base-hw/lib/mk/spec/arm_v7/core-perf_counter_on.mk rename to repos/base-hw/lib/mk/spec/arm_v7/core-hw-perf_counter_on.mk diff --git a/repos/base-hw/lib/mk/spec/arm_v7/core.inc b/repos/base-hw/lib/mk/spec/arm_v7/core-hw.inc similarity index 84% rename from repos/base-hw/lib/mk/spec/arm_v7/core.inc rename to repos/base-hw/lib/mk/spec/arm_v7/core-hw.inc index e4ac632876..477bc76646 100644 --- a/repos/base-hw/lib/mk/spec/arm_v7/core.inc +++ b/repos/base-hw/lib/mk/spec/arm_v7/core-hw.inc @@ -14,4 +14,4 @@ SRC_CC += spec/arm_v7/cpu.cc SRC_S += spec/arm_v7/mode_transition.s # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/arm/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/arm/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/arndale/core.mk b/repos/base-hw/lib/mk/spec/arndale/core-hw.mk similarity index 92% rename from repos/base-hw/lib/mk/spec/arndale/core.mk rename to repos/base-hw/lib/mk/spec/arndale/core-hw.mk index b90ca56e1f..f6e5e33c5e 100644 --- a/repos/base-hw/lib/mk/spec/arndale/core.mk +++ b/repos/base-hw/lib/mk/spec/arndale/core-hw.mk @@ -21,4 +21,4 @@ SRC_CC += spec/arm_v7/virtualization/vm_session_component.cc SRC_S += spec/arm_v7/virtualization/mode_transition.s # include less specific configuration -include $(REP_DIR)/lib/mk/spec/exynos5/core.inc +include $(REP_DIR)/lib/mk/spec/exynos5/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/cortex_a15/core.inc b/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc similarity index 81% rename from repos/base-hw/lib/mk/spec/cortex_a15/core.inc rename to repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc index 70c3d136f0..a28a5416fb 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a15/core.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a15/core-hw.inc @@ -18,5 +18,5 @@ SRC_CC += spec/arm/smp/kernel/cpu.cc SRC_S += spec/arm/smp/kernel/crt0.s # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/smp/core.inc -include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/smp/core-hw.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/cortex_a8/core.inc b/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc similarity index 87% rename from repos/base-hw/lib/mk/spec/cortex_a8/core.inc rename to repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc index 80f9c23d1a..9de85ae85e 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a8/core.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a8/core-hw.inc @@ -15,4 +15,4 @@ SRC_CC += spec/arm/kernel/thread_update_pd.cc SRC_CC += kernel/kernel.cc # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/cortex_a9/core.inc b/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc similarity index 84% rename from repos/base-hw/lib/mk/spec/cortex_a9/core.inc rename to repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc index d51cbf8c2e..e4a6391f93 100644 --- a/repos/base-hw/lib/mk/spec/cortex_a9/core.inc +++ b/repos/base-hw/lib/mk/spec/cortex_a9/core-hw.inc @@ -22,5 +22,5 @@ SRC_CC += kernel/vm_thread_off.cc SRC_S += spec/arm/smp/kernel/crt0.s # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/smp/core.inc -include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/smp/core-hw.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/arm_v7/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/exynos5/core.inc b/repos/base-hw/lib/mk/spec/exynos5/core-hw.inc similarity index 82% rename from repos/base-hw/lib/mk/spec/exynos5/core.inc rename to repos/base-hw/lib/mk/spec/exynos5/core-hw.inc index 6408711689..2b3d531673 100644 --- a/repos/base-hw/lib/mk/spec/exynos5/core.inc +++ b/repos/base-hw/lib/mk/spec/exynos5/core-hw.inc @@ -12,4 +12,4 @@ SRC_CC += spec/exynos5/platform_support.cc SRC_CC += spec/exynos5/cpu.cc # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/cortex_a15/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/cortex_a15/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/imx53/core-trustzone.inc b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone.inc similarity index 84% rename from repos/base-hw/lib/mk/spec/imx53/core-trustzone.inc rename to repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone.inc index b47d45e104..b0721fb4fd 100644 --- a/repos/base-hw/lib/mk/spec/imx53/core-trustzone.inc +++ b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone.inc @@ -10,4 +10,4 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/imx53 INC_DIR += $(REP_DIR)/src/core/include/spec/imx # include less specific configuration -include $(REP_DIR)/lib/mk/spec/cortex_a8/core.inc +include $(REP_DIR)/lib/mk/spec/cortex_a8/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/imx53/core-trustzone_off.mk b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_off.mk similarity index 76% rename from repos/base-hw/lib/mk/spec/imx53/core-trustzone_off.mk rename to repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_off.mk index 0838f978b8..ea4f1ee170 100644 --- a/repos/base-hw/lib/mk/spec/imx53/core-trustzone_off.mk +++ b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_off.mk @@ -12,5 +12,5 @@ SRC_CC += spec/imx53/pic.cc SRC_CC += platform_services.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/imx53/core-trustzone.inc -include $(REP_DIR)/lib/mk/core-trustzone.inc +include $(REP_DIR)/lib/mk/spec/imx53/core-hw-trustzone.inc +include $(REP_DIR)/lib/mk/core-hw-trustzone.inc diff --git a/repos/base-hw/lib/mk/spec/imx53/core-trustzone_on.inc b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_on.inc similarity index 87% rename from repos/base-hw/lib/mk/spec/imx53/core-trustzone_on.inc rename to repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_on.inc index 6f34c7830c..03fcd6f614 100644 --- a/repos/base-hw/lib/mk/spec/imx53/core-trustzone_on.inc +++ b/repos/base-hw/lib/mk/spec/imx53/core-hw-trustzone_on.inc @@ -22,5 +22,5 @@ SRC_CC += spec/arm_v7/trustzone/vm_session_component.cc SRC_S += spec/arm_v7/trustzone/mode_transition.s # include less specific configuration -include $(REP_DIR)/lib/mk/spec/imx53/core-trustzone.inc -include $(REP_DIR)/lib/mk/core-trustzone.inc +include $(REP_DIR)/lib/mk/spec/imx53/core-hw-trustzone.inc +include $(REP_DIR)/lib/mk/core-hw-trustzone.inc diff --git a/repos/base-hw/lib/mk/spec/imx53/core-hw.mk b/repos/base-hw/lib/mk/spec/imx53/core-hw.mk new file mode 100644 index 0000000000..c198188b4f --- /dev/null +++ b/repos/base-hw/lib/mk/spec/imx53/core-hw.mk @@ -0,0 +1 @@ +LIBS += core-hw-trustzone diff --git a/repos/base-hw/lib/mk/spec/imx53/core.mk b/repos/base-hw/lib/mk/spec/imx53/core.mk deleted file mode 100644 index 60d13212b0..0000000000 --- a/repos/base-hw/lib/mk/spec/imx53/core.mk +++ /dev/null @@ -1,9 +0,0 @@ -# -# \brief Build config for Genodes core process -# \author Stefan Kalkowski -# \author Martin Stein -# \date 2012-10-24 -# - -# add library dependencies -LIBS += core-trustzone diff --git a/repos/base-hw/lib/mk/spec/imx53_qsb/core-trustzone_on.mk b/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw-trustzone_on.mk similarity index 79% rename from repos/base-hw/lib/mk/spec/imx53_qsb/core-trustzone_on.mk rename to repos/base-hw/lib/mk/spec/imx53_qsb/core-hw-trustzone_on.mk index 427062ae99..75b71130d5 100644 --- a/repos/base-hw/lib/mk/spec/imx53_qsb/core-trustzone_on.mk +++ b/repos/base-hw/lib/mk/spec/imx53_qsb/core-hw-trustzone_on.mk @@ -8,4 +8,4 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/imx53_qsb/trustzone # include less specific configuration -include $(REP_DIR)/lib/mk/spec/imx53/core-trustzone_on.inc +include $(REP_DIR)/lib/mk/spec/imx53/core-hw-trustzone_on.inc diff --git a/repos/base-hw/lib/mk/spec/imx6/core.mk b/repos/base-hw/lib/mk/spec/imx6/core-hw.mk similarity index 88% rename from repos/base-hw/lib/mk/spec/imx6/core.mk rename to repos/base-hw/lib/mk/spec/imx6/core-hw.mk index 65fae17eb4..9c965c80df 100644 --- a/repos/base-hw/lib/mk/spec/imx6/core.mk +++ b/repos/base-hw/lib/mk/spec/imx6/core-hw.mk @@ -15,4 +15,4 @@ SRC_CC += platform_services.cc SRC_CC += spec/imx6/platform_support.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/cortex_a9/core.inc +include $(REP_DIR)/lib/mk/spec/cortex_a9/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/muen/base-hw-common.mk b/repos/base-hw/lib/mk/spec/muen/base-hw-common.mk index 39a1941605..2fb31c3c47 100644 --- a/repos/base-hw/lib/mk/spec/muen/base-hw-common.mk +++ b/repos/base-hw/lib/mk/spec/muen/base-hw-common.mk @@ -2,4 +2,4 @@ SRC_CC += sinfo.cc vpath %.cc $(REP_DIR)/src/base/muen -include $(REP_DIR)/lib/mk/spec/x86_64/base-hw-common.mk +include $(REP_DIR)/lib/mk/base-hw-common.mk diff --git a/repos/base-hw/lib/mk/spec/muen/core-hw-muen.mk b/repos/base-hw/lib/mk/spec/muen/core-hw-muen.mk new file mode 100644 index 0000000000..01afde646f --- /dev/null +++ b/repos/base-hw/lib/mk/spec/muen/core-hw-muen.mk @@ -0,0 +1 @@ +LIBS += core-hw-muen_on diff --git a/repos/base-hw/lib/mk/spec/muen/core-muen.mk b/repos/base-hw/lib/mk/spec/muen/core-muen.mk deleted file mode 100644 index bb4695faa7..0000000000 --- a/repos/base-hw/lib/mk/spec/muen/core-muen.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# \brief Build config for parts of core that depend on Muen status -# \author Stefan Kalkowski -# \date 2015-06-02 -# - -# add library dependencies -LIBS += core-muen_on diff --git a/repos/base-hw/lib/mk/spec/odroid_xu/core.mk b/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk similarity index 86% rename from repos/base-hw/lib/mk/spec/odroid_xu/core.mk rename to repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk index 13bb653164..ece403130f 100644 --- a/repos/base-hw/lib/mk/spec/odroid_xu/core.mk +++ b/repos/base-hw/lib/mk/spec/odroid_xu/core-hw.mk @@ -12,4 +12,4 @@ SRC_CC += kernel/vm_thread_off.cc SRC_CC += platform_services.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/exynos5/core.inc +include $(REP_DIR)/lib/mk/spec/exynos5/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/panda/core.mk b/repos/base-hw/lib/mk/spec/panda/core-hw.mk similarity index 87% rename from repos/base-hw/lib/mk/spec/panda/core.mk rename to repos/base-hw/lib/mk/spec/panda/core-hw.mk index 7fcd27682f..5b25772415 100644 --- a/repos/base-hw/lib/mk/spec/panda/core.mk +++ b/repos/base-hw/lib/mk/spec/panda/core-hw.mk @@ -14,4 +14,4 @@ SRC_CC += platform_services.cc SRC_CC += spec/panda/platform_support.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/cortex_a9/core.inc +include $(REP_DIR)/lib/mk/spec/cortex_a9/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/pbxa9/core.mk b/repos/base-hw/lib/mk/spec/pbxa9/core-hw.mk similarity index 88% rename from repos/base-hw/lib/mk/spec/pbxa9/core.mk rename to repos/base-hw/lib/mk/spec/pbxa9/core-hw.mk index 8327b65234..0bbc98b34a 100644 --- a/repos/base-hw/lib/mk/spec/pbxa9/core.mk +++ b/repos/base-hw/lib/mk/spec/pbxa9/core-hw.mk @@ -15,4 +15,4 @@ SRC_CC += spec/pbxa9/platform_support.cc SRC_CC += spec/pbxa9/board.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/cortex_a9/core.inc +include $(REP_DIR)/lib/mk/spec/cortex_a9/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/perf_counter/core-hw-perf_counter.mk b/repos/base-hw/lib/mk/spec/perf_counter/core-hw-perf_counter.mk new file mode 100644 index 0000000000..c6c31d61e1 --- /dev/null +++ b/repos/base-hw/lib/mk/spec/perf_counter/core-hw-perf_counter.mk @@ -0,0 +1 @@ +LIBS += core-hw-perf_counter_on diff --git a/repos/base-hw/lib/mk/spec/perf_counter/core-perf_counter.mk b/repos/base-hw/lib/mk/spec/perf_counter/core-perf_counter.mk deleted file mode 100644 index b0aafb0054..0000000000 --- a/repos/base-hw/lib/mk/spec/perf_counter/core-perf_counter.mk +++ /dev/null @@ -1,8 +0,0 @@ -# -# \brief Core build-config that depends on performance-counter status -# \author Josef Soentgen -# \date 2013-09-26 -# - -# add library dependencies -LIBS += core-perf_counter_on diff --git a/repos/base-hw/lib/mk/spec/riscv/core.mk b/repos/base-hw/lib/mk/spec/riscv/core-hw.mk similarity index 94% rename from repos/base-hw/lib/mk/spec/riscv/core.mk rename to repos/base-hw/lib/mk/spec/riscv/core-hw.mk index ecd15799c6..60583069b8 100644 --- a/repos/base-hw/lib/mk/spec/riscv/core.mk +++ b/repos/base-hw/lib/mk/spec/riscv/core-hw.mk @@ -20,4 +20,4 @@ SRC_S += spec/riscv/crt0.s # include less specific configuration -include $(REP_DIR)/lib/mk/core.inc +include $(REP_DIR)/lib/mk/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/riscv/startup.mk b/repos/base-hw/lib/mk/spec/riscv/startup-hw.mk similarity index 100% rename from repos/base-hw/lib/mk/spec/riscv/startup.mk rename to repos/base-hw/lib/mk/spec/riscv/startup-hw.mk diff --git a/repos/base-hw/lib/mk/spec/rpi/core.mk b/repos/base-hw/lib/mk/spec/rpi/core-hw.mk similarity index 87% rename from repos/base-hw/lib/mk/spec/rpi/core.mk rename to repos/base-hw/lib/mk/spec/rpi/core-hw.mk index 1abbf745e1..aed02ed36c 100644 --- a/repos/base-hw/lib/mk/spec/rpi/core.mk +++ b/repos/base-hw/lib/mk/spec/rpi/core-hw.mk @@ -13,4 +13,4 @@ SRC_CC += platform_services.cc SRC_CC += spec/rpi/platform_support.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/arm_v6/core.inc +include $(REP_DIR)/lib/mk/spec/arm_v6/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/smp/core.inc b/repos/base-hw/lib/mk/spec/smp/core-hw.inc similarity index 100% rename from repos/base-hw/lib/mk/spec/smp/core.inc rename to repos/base-hw/lib/mk/spec/smp/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/trustzone/core-hw-trustzone.mk b/repos/base-hw/lib/mk/spec/trustzone/core-hw-trustzone.mk new file mode 100644 index 0000000000..d386137286 --- /dev/null +++ b/repos/base-hw/lib/mk/spec/trustzone/core-hw-trustzone.mk @@ -0,0 +1 @@ +LIBS += core-hw-trustzone_on diff --git a/repos/base-hw/lib/mk/spec/usb_armory/core-trustzone_on.mk b/repos/base-hw/lib/mk/spec/usb_armory/core-hw-trustzone_on.mk similarity index 79% rename from repos/base-hw/lib/mk/spec/usb_armory/core-trustzone_on.mk rename to repos/base-hw/lib/mk/spec/usb_armory/core-hw-trustzone_on.mk index b0c90b1b33..5a3d407e50 100644 --- a/repos/base-hw/lib/mk/spec/usb_armory/core-trustzone_on.mk +++ b/repos/base-hw/lib/mk/spec/usb_armory/core-hw-trustzone_on.mk @@ -8,4 +8,4 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/usb_armory # include less specific configuration -include $(REP_DIR)/lib/mk/spec/imx53/core-trustzone_on.inc +include $(REP_DIR)/lib/mk/spec/imx53/core-hw-trustzone_on.inc diff --git a/repos/base-hw/lib/mk/spec/x86_64/core-muen_off.mk b/repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_off.mk similarity index 90% rename from repos/base-hw/lib/mk/spec/x86_64/core-muen_off.mk rename to repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_off.mk index 0ca30a7c64..ec2d80a0ed 100644 --- a/repos/base-hw/lib/mk/spec/x86_64/core-muen_off.mk +++ b/repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_off.mk @@ -16,4 +16,4 @@ SRC_CC += spec/x86_64/platform_support.cc SRC_CC += spec/x86/platform_services.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/x86_64/core.inc +include $(REP_DIR)/lib/mk/spec/x86_64/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/x86_64/core-muen_on.mk b/repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_on.mk similarity index 92% rename from repos/base-hw/lib/mk/spec/x86_64/core-muen_on.mk rename to repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_on.mk index 3f29ce81bb..a33e7ced1f 100644 --- a/repos/base-hw/lib/mk/spec/x86_64/core-muen_on.mk +++ b/repos/base-hw/lib/mk/spec/x86_64/core-hw-muen_on.mk @@ -21,4 +21,4 @@ SRC_CC += spec/x86_64/muen/platform_services.cc SRC_CC += kernel/vm_thread_on.cc # include less specific configuration -include $(REP_DIR)/lib/mk/spec/x86_64/core.inc +include $(REP_DIR)/lib/mk/spec/x86_64/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/x86_64/core.inc b/repos/base-hw/lib/mk/spec/x86_64/core-hw.inc similarity index 94% rename from repos/base-hw/lib/mk/spec/x86_64/core.inc rename to repos/base-hw/lib/mk/spec/x86_64/core-hw.inc index b8dd78cac8..fa6638b9ad 100644 --- a/repos/base-hw/lib/mk/spec/x86_64/core.inc +++ b/repos/base-hw/lib/mk/spec/x86_64/core-hw.inc @@ -30,4 +30,4 @@ SRC_CC += spec/x86_64/platform_support_common.cc SRC_CC += spec/x86_64/tss.cc # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/x86_64/core.mk b/repos/base-hw/lib/mk/spec/x86_64/core-hw.mk similarity index 82% rename from repos/base-hw/lib/mk/spec/x86_64/core.mk rename to repos/base-hw/lib/mk/spec/x86_64/core-hw.mk index 711d294fc4..b3855903fd 100644 --- a/repos/base-hw/lib/mk/spec/x86_64/core.mk +++ b/repos/base-hw/lib/mk/spec/x86_64/core-hw.mk @@ -4,4 +4,4 @@ # \date 2015-06-02 # -LIBS += core-muen +LIBS += core-hw-muen diff --git a/repos/base-hw/lib/mk/spec/x86_64/startup-hw.mk b/repos/base-hw/lib/mk/spec/x86_64/startup-hw.mk new file mode 100644 index 0000000000..94807e2150 --- /dev/null +++ b/repos/base-hw/lib/mk/spec/x86_64/startup-hw.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/x86_64/startup.inc diff --git a/repos/base-hw/lib/mk/spec/zynq/core.inc b/repos/base-hw/lib/mk/spec/zynq/core-hw.inc similarity index 82% rename from repos/base-hw/lib/mk/spec/zynq/core.inc rename to repos/base-hw/lib/mk/spec/zynq/core-hw.inc index ccd0a0abc4..bf8b7f653d 100644 --- a/repos/base-hw/lib/mk/spec/zynq/core.inc +++ b/repos/base-hw/lib/mk/spec/zynq/core-hw.inc @@ -12,4 +12,4 @@ SRC_CC += platform_services.cc SRC_CC += spec/zynq/platform_support.cc # include less specific configuration -include $(BASE_DIR)/../base-hw/lib/mk/spec/cortex_a9/core.inc +include $(BASE_DIR)/../base-hw/lib/mk/spec/cortex_a9/core-hw.inc diff --git a/repos/base-hw/lib/mk/spec/zynq_qemu/core.mk b/repos/base-hw/lib/mk/spec/zynq_qemu/core-hw.mk similarity index 85% rename from repos/base-hw/lib/mk/spec/zynq_qemu/core.mk rename to repos/base-hw/lib/mk/spec/zynq_qemu/core-hw.mk index 247268b3fa..7402b8868b 100644 --- a/repos/base-hw/lib/mk/spec/zynq_qemu/core.mk +++ b/repos/base-hw/lib/mk/spec/zynq_qemu/core-hw.mk @@ -9,4 +9,4 @@ INC_DIR += $(REP_DIR)/src/core/include/spec/xilinx_uartps_0 INC_DIR += $(REP_DIR)/src/core/include/spec/zynq_qemu # include less specific configuration -include $(REP_DIR)/lib/mk/spec/zynq/core.inc +include $(REP_DIR)/lib/mk/spec/zynq/core-hw.inc diff --git a/repos/base-hw/src/core/hw/target.mk b/repos/base-hw/src/core/hw/target.mk new file mode 100644 index 0000000000..a96f38c039 --- /dev/null +++ b/repos/base-hw/src/core/hw/target.mk @@ -0,0 +1,3 @@ +LIBS = core-hw + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-linux/etc/specs.conf b/repos/base-linux/etc/specs.conf index c5cb82c971..e6290e0221 100644 --- a/repos/base-linux/etc/specs.conf +++ b/repos/base-linux/etc/specs.conf @@ -1,30 +1,23 @@ -# -# Description of build platform -# + +SPECS += genode linux sdl # -# If you want to build the Linux-specific Genode -# binaries, use this config option. +# Detect host CPU architecture # -ifeq ($(shell uname -m),x86_64) -SPECS ?= genode linux_x86_64 sdl -else -ifeq ($(shell uname -m),armv6l) -SPECS ?= genode linux_arm sdl arm_v6 -else -ifeq ($(shell uname -m),armv7l) -SPECS ?= genode linux_arm sdl arm_v7a -else -SPECS ?= genode linux_x86_32 sdl -endif -endif +UNAME_MACHINE := $(shell uname -m) + +ifeq ($(UNAME_MACHINE),i686) +SPECS += x86_32 endif -# -# If you want to build for the host platform, -# use the following config option. -# You need to specify '32bit' additionally to 'host' -# to include the 32bit-specific Genode include path -# containing integer definitions. -# -#SPECS ?= host 32bit +ifeq ($(UNAME_MACHINE),x86_64) +SPECS += x86_64 +endif + +ifeq ($(UNAME_MACHINE),armv6l) +SPECS += arm_v6 +endif + +ifeq ($(UNAME_MACHINE),armv7l) +SPECS += arm_v7a +endif diff --git a/repos/base-linux/lib/import/import-lx_hybrid.mk b/repos/base-linux/lib/import/import-lx_hybrid.mk index 860ba8e3fc..b6a67756b7 100644 --- a/repos/base-linux/lib/import/import-lx_hybrid.mk +++ b/repos/base-linux/lib/import/import-lx_hybrid.mk @@ -1,7 +1,7 @@ # # Make Linux headers of the host platform available to the program # -include $(call select_from_repositories,lib/import/import-syscall.mk) +include $(call select_from_repositories,lib/import/import-syscall-linux.mk) # # Manually supply all library search paths of the host compiler to our tool @@ -65,31 +65,37 @@ endif # # Use the host's startup codes, linker script, and dynamic linker # -ifneq ($(filter hardening_tool_chain, $(SPECS)),) -EXT_OBJECTS += $(shell cc $(CC_MARCH) -print-file-name=Scrt1.o) -EXT_OBJECTS += $(shell cc $(CC_MARCH) -print-file-name=crti.o) -EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtbeginS.o) -EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtendS.o) -else +LD_TEXT_ADDR ?= +LD_SCRIPT_STATIC ?= + EXT_OBJECTS += $(shell cc $(CC_MARCH) -print-file-name=crt1.o) EXT_OBJECTS += $(shell cc $(CC_MARCH) -print-file-name=crti.o) EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtbegin.o) EXT_OBJECTS += $(shell $(CUSTOM_CC) $(CC_MARCH) -print-file-name=crtend.o) -endif EXT_OBJECTS += $(shell cc $(CC_MARCH) -print-file-name=crtn.o) LX_LIBS_OPT += -lgcc -lgcc_s -lsupc++ -lc -lpthread USE_HOST_LD_SCRIPT = yes +# +# We need to manually add the default linker script on the command line in case +# of standard library use. Otherwise, we were not able to extend it by the +# stack area section. +# ifeq (x86_64,$(findstring x86_64,$(SPECS))) -CXX_LINK_OPT += -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 -else -ifeq (arm,$(findstring arm,$(SPECS))) -CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.3 -else -CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.2 +CXX_LINK_OPT += -Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2 +LD_SCRIPT_DEFAULT = ldscripts/elf_x86_64.xc endif + +ifeq (x86_32,$(findstring x86_32,$(SPECS))) +CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.2 +LD_SCRIPT_DEFAULT = ldscripts/elf_i386.xc +endif + +ifeq (arm,$(findstring arm,$(SPECS))) +CXX_LINK_OPT += -Wl,--dynamic-linker=/lib/ld-linux.so.3 +LD_SCRIPT_STATIC = ldscripts/armelf_linux_eabi.xc endif # diff --git a/repos/base-linux/lib/import/import-syscall.mk b/repos/base-linux/lib/import/import-syscall-linux.mk similarity index 100% rename from repos/base-linux/lib/import/import-syscall.mk rename to repos/base-linux/lib/import/import-syscall-linux.mk diff --git a/repos/base-linux/lib/mk/base-linux-common.mk b/repos/base-linux/lib/mk/base-linux-common.mk index c45aaddcfb..1227f67c2d 100644 --- a/repos/base-linux/lib/mk/base-linux-common.mk +++ b/repos/base-linux/lib/mk/base-linux-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += syscall +LIBS += syscall-linux SRC_CC += region_map_mmap.cc debug.cc SRC_CC += signal_submit.cc diff --git a/repos/base-linux/lib/mk/base-linux.inc b/repos/base-linux/lib/mk/base-linux.inc index 6baebafa44..d68b3fea09 100644 --- a/repos/base-linux/lib/mk/base-linux.inc +++ b/repos/base-linux/lib/mk/base-linux.inc @@ -7,4 +7,4 @@ include $(BASE_DIR)/lib/mk/base.inc SRC_CC += platform_env.cc -LIBS += syscall cxx +LIBS += syscall-linux cxx diff --git a/repos/base-linux/lib/mk/base-linux.mk b/repos/base-linux/lib/mk/base-linux.mk index a1767a1a55..f020b24ae0 100644 --- a/repos/base-linux/lib/mk/base-linux.mk +++ b/repos/base-linux/lib/mk/base-linux.mk @@ -6,7 +6,7 @@ include $(REP_DIR)/lib/mk/base-linux.inc -LIBS += startup base-linux-common +LIBS += startup-linux base-linux-common SRC_CC += thread.cc thread_myself.cc thread_linux.cc SRC_CC += capability_space.cc capability_raw.cc SRC_CC += attach_stack_area.cc diff --git a/repos/base-linux/lib/mk/spec/arm/startup-linux.mk b/repos/base-linux/lib/mk/spec/arm/startup-linux.mk new file mode 100644 index 0000000000..6123496d87 --- /dev/null +++ b/repos/base-linux/lib/mk/spec/arm/startup-linux.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/arm/startup.inc diff --git a/repos/base-linux/lib/mk/spec/arm/syscall.mk b/repos/base-linux/lib/mk/spec/arm/syscall-linux.mk similarity index 100% rename from repos/base-linux/lib/mk/spec/arm/syscall.mk rename to repos/base-linux/lib/mk/spec/arm/syscall-linux.mk diff --git a/repos/base-linux/lib/mk/spec/x86_32/startup-linux.mk b/repos/base-linux/lib/mk/spec/x86_32/startup-linux.mk new file mode 100644 index 0000000000..03c229de2e --- /dev/null +++ b/repos/base-linux/lib/mk/spec/x86_32/startup-linux.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc diff --git a/repos/base-linux/lib/mk/spec/x86_32/syscall.mk b/repos/base-linux/lib/mk/spec/x86_32/syscall-linux.mk similarity index 100% rename from repos/base-linux/lib/mk/spec/x86_32/syscall.mk rename to repos/base-linux/lib/mk/spec/x86_32/syscall-linux.mk diff --git a/repos/base-linux/lib/mk/spec/x86_64/startup-linux.mk b/repos/base-linux/lib/mk/spec/x86_64/startup-linux.mk new file mode 100644 index 0000000000..94807e2150 --- /dev/null +++ b/repos/base-linux/lib/mk/spec/x86_64/startup-linux.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/x86_64/startup.inc diff --git a/repos/base-linux/lib/mk/spec/x86_64/syscall.mk b/repos/base-linux/lib/mk/spec/x86_64/syscall-linux.mk similarity index 100% rename from repos/base-linux/lib/mk/spec/x86_64/syscall.mk rename to repos/base-linux/lib/mk/spec/x86_64/syscall-linux.mk diff --git a/repos/base-linux/mk/spec/linux.mk b/repos/base-linux/mk/spec/linux.mk deleted file mode 100644 index d920aab7ac..0000000000 --- a/repos/base-linux/mk/spec/linux.mk +++ /dev/null @@ -1,21 +0,0 @@ -# -# Specifics for the Linux-specific Genode components -# - -# -# Startup code to be used when building a program and linker script that is -# specific for Linux. We also reserve the stack area via a segment in -# the program under Linux to prevent clashes with vdso. -# -ifneq ($(USE_HOST_LD_SCRIPT),yes) -LD_TEXT_ADDR ?= 0x01000000 -LD_SCRIPT_STATIC = $(call select_from_repositories,src/ld/genode.ld) \ - $(call select_from_repositories,src/ld/stack_area.nostdlib.ld) -else -LD_TEXT_ADDR ?= -LD_SCRIPT_STATIC ?= -endif - -ifneq ($(filter hardening_tool_chain, $(SPECS)),) -CC_OPT += -fPIC -endif diff --git a/repos/base-linux/mk/spec/linux_arm.mk b/repos/base-linux/mk/spec/linux_arm.mk deleted file mode 100644 index 262db0186e..0000000000 --- a/repos/base-linux/mk/spec/linux_arm.mk +++ /dev/null @@ -1,23 +0,0 @@ -# -# Specifics for Linux on ARM -# -SPECS += linux arm - -ifeq ($(shell gcc -dumpmachine),arm-linux-gnueabihf) -CC_MARCH += -mfloat-abi=hard -endif - -# -# We need to manually add the default linker script on the command line in case -# of standard library use. Otherwise, we were not able to extend it by the -# stack area section. -# -ifeq ($(USE_HOST_LD_SCRIPT),yes) -LD_SCRIPT_STATIC = ldscripts/armelf_linux_eabi.xc -endif - -# -# Include less-specific configuration -# -include $(call select_from_repositories,mk/spec/arm.mk) -include $(call select_from_repositories,mk/spec/linux.mk) diff --git a/repos/base-linux/mk/spec/linux_x86_32.mk b/repos/base-linux/mk/spec/linux_x86_32.mk deleted file mode 100644 index dbea24d8a2..0000000000 --- a/repos/base-linux/mk/spec/linux_x86_32.mk +++ /dev/null @@ -1,19 +0,0 @@ -# -# Specifics for Linux on 32-bit x86 -# -SPECS += linux x86_32 - -# -# We need to manually add the default linker script on the command line in case -# of standard library use. Otherwise, we were not able to extend it by the -# stack area section. -# -ifeq ($(USE_HOST_LD_SCRIPT),yes) -LD_SCRIPT_DEFAULT = ldscripts/elf_i386.xc -endif - -# -# Include less-specific configuration -# -include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/linux.mk) diff --git a/repos/base-linux/mk/spec/linux_x86_64.mk b/repos/base-linux/mk/spec/linux_x86_64.mk deleted file mode 100644 index b9f5cdfc07..0000000000 --- a/repos/base-linux/mk/spec/linux_x86_64.mk +++ /dev/null @@ -1,20 +0,0 @@ -# -# Specifics for Linux on 64-bit x86 -# -SPECS += linux x86_64 - -# -# We need to manually add the default linker script on the command line in case -# of standard library use. Otherwise, we were not able to extend it by the -# stack area section. -# -ifeq ($(USE_HOST_LD_SCRIPT),yes) -LD_SCRIPT_DEFAULT = ldscripts/elf_x86_64.xc -endif - -# -# Include less-specific configuration -# -include $(call select_from_repositories,mk/spec/x86_64.mk) -include $(call select_from_repositories,mk/spec/linux.mk) - diff --git a/repos/base-linux/src/core/target.mk b/repos/base-linux/src/core/linux/target.mk similarity index 87% rename from repos/base-linux/src/core/target.mk rename to repos/base-linux/src/core/linux/target.mk index 0234ffd24c..6e0985bda1 100644 --- a/repos/base-linux/src/core/target.mk +++ b/repos/base-linux/src/core/linux/target.mk @@ -1,6 +1,6 @@ -TARGET = core +TARGET = core-linux REQUIRES = linux -LIBS = cxx base-linux-common syscall startup +LIBS = cxx base-linux-common syscall-linux startup-linux GEN_CORE_DIR = $(BASE_DIR)/src/core @@ -38,7 +38,9 @@ INC_DIR += $(REP_DIR)/src/core/include \ $(REP_DIR)/src/include \ $(BASE_DIR)/src/include -HOST_INC_DIR += /usr/include +LD_TEXT_ADDR ?= 0x01000000 +LD_SCRIPT_STATIC = $(call select_from_repositories,src/ld/genode.ld) \ + $(call select_from_repositories,src/ld/stack_area.nostdlib.ld) include $(GEN_CORE_DIR)/version.inc @@ -59,4 +61,4 @@ vpath thread.cc $(BASE_DIR)/src/lib/base vpath thread_myself.cc $(BASE_DIR)/src/lib/base vpath trace.cc $(BASE_DIR)/src/lib/base vpath env_reinit.cc $(REP_DIR)/src/lib/base -vpath %.cc $(PRG_DIR) +vpath %.cc $(REP_DIR)/src/core diff --git a/repos/base-nova/etc/specs.conf b/repos/base-nova/etc/specs.conf index a1da9ef86a..07749c890c 100644 --- a/repos/base-nova/etc/specs.conf +++ b/repos/base-nova/etc/specs.conf @@ -1,5 +1 @@ -# -# Description of build platform -# - -SPECS ?= genode nova_x86_32 +SPECS += genode nova vesa acpi pci ps2 framebuffer diff --git a/repos/base-nova/lib/mk/base-nova-common.mk b/repos/base-nova/lib/mk/base-nova-common.mk index 3656e3a9e2..29a55a50be 100644 --- a/repos/base-nova/lib/mk/base-nova-common.mk +++ b/repos/base-nova/lib/mk/base-nova-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += startup +LIBS += startup-nova SRC_CC += signal_submit.cc SRC_CC += thread.cc thread_myself.cc diff --git a/repos/base-nova/lib/mk/core.inc b/repos/base-nova/lib/mk/core-nova.inc similarity index 100% rename from repos/base-nova/lib/mk/core.inc rename to repos/base-nova/lib/mk/core-nova.inc diff --git a/repos/base-nova/lib/mk/spec/x86_32/core-nova.mk b/repos/base-nova/lib/mk/spec/x86_32/core-nova.mk new file mode 100644 index 0000000000..7c08a9d1e7 --- /dev/null +++ b/repos/base-nova/lib/mk/spec/x86_32/core-nova.mk @@ -0,0 +1,3 @@ +SRC_CC += spec/x86_32/pager.cc + +include $(REP_DIR)/lib/mk/core-nova.inc diff --git a/repos/base-nova/lib/mk/spec/x86_32/core.mk b/repos/base-nova/lib/mk/spec/x86_32/core.mk deleted file mode 100644 index 123786d518..0000000000 --- a/repos/base-nova/lib/mk/spec/x86_32/core.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC_CC += spec/x86_32/pager.cc - -include $(REP_DIR)/lib/mk/core.inc diff --git a/repos/base-nova/lib/mk/spec/x86_32/startup-nova.mk b/repos/base-nova/lib/mk/spec/x86_32/startup-nova.mk new file mode 100644 index 0000000000..03c229de2e --- /dev/null +++ b/repos/base-nova/lib/mk/spec/x86_32/startup-nova.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc diff --git a/repos/base-nova/lib/mk/spec/x86_64/core-nova.mk b/repos/base-nova/lib/mk/spec/x86_64/core-nova.mk new file mode 100644 index 0000000000..0424e85c4f --- /dev/null +++ b/repos/base-nova/lib/mk/spec/x86_64/core-nova.mk @@ -0,0 +1,3 @@ +SRC_CC += spec/x86_64/pager.cc + +include $(REP_DIR)/lib/mk/core-nova.inc diff --git a/repos/base-nova/lib/mk/spec/x86_64/core.mk b/repos/base-nova/lib/mk/spec/x86_64/core.mk deleted file mode 100644 index 9943890cd1..0000000000 --- a/repos/base-nova/lib/mk/spec/x86_64/core.mk +++ /dev/null @@ -1,3 +0,0 @@ -SRC_CC += spec/x86_64/pager.cc - -include $(REP_DIR)/lib/mk/core.inc diff --git a/repos/base-nova/lib/mk/spec/x86_64/startup-nova.mk b/repos/base-nova/lib/mk/spec/x86_64/startup-nova.mk new file mode 100644 index 0000000000..94807e2150 --- /dev/null +++ b/repos/base-nova/lib/mk/spec/x86_64/startup-nova.mk @@ -0,0 +1 @@ +include $(BASE_DIR)/lib/mk/spec/x86_64/startup.inc diff --git a/repos/base-nova/mk/spec/nova.mk b/repos/base-nova/mk/spec/nova.mk deleted file mode 100644 index c8547a4208..0000000000 --- a/repos/base-nova/mk/spec/nova.mk +++ /dev/null @@ -1,14 +0,0 @@ -# -# Specifics for the NOVA kernel API -# - -SPECS += nova -SPECS += pci ps2 vesa framebuffer - -# -# We would normally have to do this only in the kernel lib. We do it in -# general nonetheless to ensure that the kernel port, if missing, is added to -# the missing-ports list of the first build stage. The kernel lib is evaluated -# only at a later build stage. -# -NOVA_SRC_DIR := $(call select_from_ports,nova)/src/kernel/nova diff --git a/repos/base-nova/mk/spec/nova_x86_32.mk b/repos/base-nova/mk/spec/nova_x86_32.mk index 6dbadf00ce..17b2b520b5 100644 --- a/repos/base-nova/mk/spec/nova_x86_32.mk +++ b/repos/base-nova/mk/spec/nova_x86_32.mk @@ -1,8 +1,4 @@ -# -# Specifics for the NOVA kernel API x86 32 bit -# - -SPECS += nova x86_32 +# \deprecated +SPECS += x86_32 include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/nova.mk) diff --git a/repos/base-nova/mk/spec/nova_x86_64.mk b/repos/base-nova/mk/spec/nova_x86_64.mk index 7403c8e413..4aa51fa4ee 100644 --- a/repos/base-nova/mk/spec/nova_x86_64.mk +++ b/repos/base-nova/mk/spec/nova_x86_64.mk @@ -1,8 +1,4 @@ -# -# Specifics for the NOVA kernel API x86 64 bit -# - -SPECS += nova x86_64 +# \deprecated +SPECS += x86_64 include $(call select_from_repositories,mk/spec/x86_64.mk) -include $(call select_from_repositories,mk/spec/nova.mk) diff --git a/repos/base-nova/src/core/nova/target.mk b/repos/base-nova/src/core/nova/target.mk new file mode 100644 index 0000000000..7af8cfc600 --- /dev/null +++ b/repos/base-nova/src/core/nova/target.mk @@ -0,0 +1,3 @@ +LIBS = core-nova + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-nova/src/kernel/target.mk b/repos/base-nova/src/kernel/nova/target.mk similarity index 97% rename from repos/base-nova/src/kernel/target.mk rename to repos/base-nova/src/kernel/nova/target.mk index d078584b38..0b9d41ecbf 100644 --- a/repos/base-nova/src/kernel/target.mk +++ b/repos/base-nova/src/kernel/nova/target.mk @@ -3,6 +3,7 @@ include $(call select_from_repositories,mk/spec/nova.mk) TARGET = hypervisor REQUIRES = x86 nova NOVA_BUILD_DIR = $(BUILD_BASE_DIR)/kernel +NOVA_SRC_DIR = $(call select_from_ports,nova)/src/kernel/nova SRC_CC = $(sort $(notdir $(wildcard $(NOVA_SRC_DIR)/src/*.cpp))) SRC_S = $(sort $(notdir $(wildcard $(NOVA_SRC_DIR)/src/*.S))) INC_DIR = $(NOVA_SRC_DIR)/include diff --git a/repos/base-okl4/etc/specs.conf b/repos/base-okl4/etc/specs.conf index 5fa30f2ff6..901c175a41 100644 --- a/repos/base-okl4/etc/specs.conf +++ b/repos/base-okl4/etc/specs.conf @@ -1 +1 @@ -SPECS = genode okl4_x86 +SPECS += genode okl4 x86_32 vesa pci ps2 framebuffer diff --git a/repos/base-okl4/lib/import/import-kernel-okl4-include.mk b/repos/base-okl4/lib/import/import-kernel-okl4-include.mk new file mode 100644 index 0000000000..a7274d4045 --- /dev/null +++ b/repos/base-okl4/lib/import/import-kernel-okl4-include.mk @@ -0,0 +1,3 @@ +OKL4_SRC_DIR := $(call select_from_ports,okl4)/src/kernel/okl4 + +INC_DIR += $(LIB_CACHE_DIR)/kernel-okl4-include/include diff --git a/repos/base-okl4/lib/import/import-syscall-okl4.mk b/repos/base-okl4/lib/import/import-syscall-okl4.mk new file mode 100644 index 0000000000..030693d8b7 --- /dev/null +++ b/repos/base-okl4/lib/import/import-syscall-okl4.mk @@ -0,0 +1,23 @@ +OKL4_DIR = $(call select_from_ports,okl4)/src/kernel/okl4 + +# +# Make sure that symlink modification times are handled correctly. +# Otherwise, the creation of symlinks that depend on their own directory +# behaves like a phony rule. This is because the directory mtime is +# determined by taking the mtimes of containing symlinks into account. +# Hence, all symlinks (except for the youngest) depend on a directory +# with a newer mtime. The make flag -L fixes the problem. Alternatively, +# we could use 'cp' instead of 'ln'. +# +MAKEFLAGS += -L + +# +# OKL4-specific headers +# +INC_DIR += $(LIB_CACHE_DIR)/syscall-okl4/include + +# +# Define maximum number of threads, needed by the OKL4 kernel headers +# +CC_OPT += -DCONFIG_MAX_THREAD_BITS=10 + diff --git a/repos/base-okl4/lib/mk/base-okl4-common.mk b/repos/base-okl4/lib/mk/base-okl4-common.mk index 9d03d7f921..6781caaf0c 100644 --- a/repos/base-okl4/lib/mk/base-okl4-common.mk +++ b/repos/base-okl4/lib/mk/base-okl4-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += startup +LIBS += startup-okl4 syscall-okl4 SRC_CC += capability.cc capability_raw.cc SRC_CC += signal_submit.cc diff --git a/repos/base-okl4/lib/mk/base-okl4.mk b/repos/base-okl4/lib/mk/base-okl4.mk index abe953de6d..b2b05fccba 100644 --- a/repos/base-okl4/lib/mk/base-okl4.mk +++ b/repos/base-okl4/lib/mk/base-okl4.mk @@ -1,6 +1,6 @@ include $(BASE_DIR)/lib/mk/base.inc -LIBS += base-okl4-common +LIBS += base-okl4-common syscall-okl4 SRC_CC += thread_start.cc SRC_CC += cache.cc SRC_CC += capability_space.cc diff --git a/repos/base-okl4/lib/mk/core.inc b/repos/base-okl4/lib/mk/core-okl4.inc similarity index 97% rename from repos/base-okl4/lib/mk/core.inc rename to repos/base-okl4/lib/mk/core-okl4.inc index 13a6e66621..ccda89f800 100644 --- a/repos/base-okl4/lib/mk/core.inc +++ b/repos/base-okl4/lib/mk/core-okl4.inc @@ -1,6 +1,6 @@ CC_OPT_PIC = -LIBS += boot_info base-okl4-common +LIBS += okl4_boot_info base-okl4-common syscall-okl4 GEN_CORE_DIR = $(BASE_DIR)/src/core diff --git a/repos/base-okl4/lib/mk/kernel.inc b/repos/base-okl4/lib/mk/kernel-okl4-include.inc similarity index 83% rename from repos/base-okl4/lib/mk/kernel.inc rename to repos/base-okl4/lib/mk/kernel-okl4-include.inc index 21495f2e2a..a4ed744365 100644 --- a/repos/base-okl4/lib/mk/kernel.inc +++ b/repos/base-okl4/lib/mk/kernel-okl4-include.inc @@ -67,31 +67,33 @@ INC_SYMLINKS += atomic_ops/atomic_ops.h \ l4/macros.h \ l4/types.h -SYMLINK_TARGETS = $(addprefix $(OKL4_BUILD_DIR)/include/,$(INC_SYMLINKS)) +SYMLINK_TARGETS = $(addprefix include/,$(INC_SYMLINKS)) SYMLINK_DIRS = $(sort $(dir $(SYMLINK_TARGETS))) +ifeq ($(called_from_lib_mk),yes) all: $(SYMLINK_TARGETS) +endif $(SYMLINK_TARGETS): $(filter-out $(wildcard $(SYMLINK_DIRS)), $(SYMLINK_DIRS)) $(SYMLINK_DIRS): $(VERBOSE)mkdir -p $@ -$(OKL4_BUILD_DIR)/include/kernel/kdb/%.h: $(OKL4_SRC_DIR)/pistachio/kdb/include/%.h +include/kernel/kdb/%.h: $(OKL4_SRC_DIR)/pistachio/kdb/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/kdb/%.h: $(OKL4_SRC_DIR)/pistachio/kdb/include/%.h +include/kdb/%.h: $(OKL4_SRC_DIR)/pistachio/kdb/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/kernel/%.h: $(OKL4_SRC_DIR)/pistachio/include/%.h +include/kernel/%.h: $(OKL4_SRC_DIR)/pistachio/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/compat/%.h: $(OKL4_SRC_DIR)/libs/compat/include/compat/%.h +include/compat/%.h: $(OKL4_SRC_DIR)/libs/compat/include/compat/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/atomic_ops/%.h: $(OKL4_SRC_DIR)/libs/atomic_ops/include/%.h +include/atomic_ops/%.h: $(OKL4_SRC_DIR)/libs/atomic_ops/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/l4/%.h: $(OKL4_SRC_DIR)/libs/l4/include/%.h +include/l4/%.h: $(OKL4_SRC_DIR)/libs/l4/include/%.h $(VERBOSE)ln -s $< $@ diff --git a/repos/base-okl4/src/kernel/target.inc b/repos/base-okl4/lib/mk/kernel-okl4.inc similarity index 84% rename from repos/base-okl4/src/kernel/target.inc rename to repos/base-okl4/lib/mk/kernel-okl4.inc index 8d7914f40f..36fcb1b6af 100644 --- a/repos/base-okl4/src/kernel/target.inc +++ b/repos/base-okl4/lib/mk/kernel-okl4.inc @@ -1,9 +1,5 @@ -TARGET = kernel -OKL4_SRC_DIR = $(call select_from_ports,okl4)/src/kernel/okl4 -OKL4_BUILD_DIR = $(BUILD_BASE_DIR)/kernel -REQUIRES += okl4 -LIBS = kernel -SRC_O += $(addprefix $(OKL4_BUILD_DIR)/asm/,$(addsuffix .o,$(basename $(SRC_SPP)))) +LIBS = kernel-okl4-include +SRC_O += $(addprefix asm/,$(addsuffix .o,$(basename $(SRC_SPP)))) SRC_CC += $(subst $(OKL4_SRC_DIR)/,,$(wildcard $(OKL4_SRC_DIR)/pistachio/kdb/src/*.cc)) \ $(subst $(OKL4_SRC_DIR)/,,$(wildcard $(OKL4_SRC_DIR)/pistachio/src/*.cc)) CONFIG += __API__=v4 \ @@ -44,8 +40,11 @@ CC_OPT += -Wno-write-strings -Wredundant-decls -Wundef \ -fno-asynchronous-unwind-tables \ -finline-limit=99999999 $(addprefix -D,$(CONFIG)) \ "-D__USER__=\"Genode Labs\"" +CC_OPT += -DCONFIG_MAX_THREAD_BITS=10 -CC_WARN = -Wall -Wno-unused-but-set-variable -Wno-uninitialized +CC_OPT_PIC = + +CC_WARN := -Wall -Wno-unused-but-set-variable -Wno-uninitialized # # Enforce building the kernel with -O3. Otherwise, the kernel build would fail @@ -54,13 +53,10 @@ CC_WARN = -Wall -Wno-unused-but-set-variable -Wno-uninitialized # override CC_OLEVEL = -O3 -$(OKL4_BUILD_DIR)/asm/%.o: $(OKL4_SRC_DIR)/%.spp +asm/%.o: $(OKL4_SRC_DIR)/%.spp $(MSG_COMP)$*.spp $(VERBOSE)$(CC) $(CC_MARCH) -x assembler-with-cpp -DASSEMBLY \ $(addprefix -D,$(CONFIG)) \ $(addprefix -I,$(INC_DIR)) -c $< -o $@ -clean cleanall: - $(VERBOSE)rm -rf $(OKL4_BUILD_DIR) - vpath %.cc $(OKL4_SRC_DIR) diff --git a/repos/base-okl4/lib/mk/boot_info.mk b/repos/base-okl4/lib/mk/okl4_boot_info.mk similarity index 65% rename from repos/base-okl4/lib/mk/boot_info.mk rename to repos/base-okl4/lib/mk/okl4_boot_info.mk index cb8f15929b..74d9a4b07f 100644 --- a/repos/base-okl4/lib/mk/boot_info.mk +++ b/repos/base-okl4/lib/mk/okl4_boot_info.mk @@ -1,5 +1,7 @@ SRC_C = bootinfo.c +LIBS += syscall-okl4 INC_DIR += $(REP_DIR)/src/include/bootinfo/internal CC_WARN = -Wall -Wno-attributes +OKL4_DIR = $(call select_from_ports,okl4)/src/kernel/okl4 vpath bootinfo.c $(OKL4_DIR)/libs/bootinfo/src diff --git a/repos/base-okl4/lib/mk/spec/x86/core.mk b/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk similarity index 89% rename from repos/base-okl4/lib/mk/spec/x86/core.mk rename to repos/base-okl4/lib/mk/spec/x86/core-okl4.mk index 340df644ce..02c1cd93af 100644 --- a/repos/base-okl4/lib/mk/spec/x86/core.mk +++ b/repos/base-okl4/lib/mk/spec/x86/core-okl4.mk @@ -1,6 +1,4 @@ -include $(REP_DIR)/lib/mk/core.inc - -REQUIRES += x86 +include $(REP_DIR)/lib/mk/core-okl4.inc SRC_CC += io_port_session_component.cc \ io_port_session_support.cc \ diff --git a/repos/base-okl4/lib/mk/spec/x86/kernel.mk b/repos/base-okl4/lib/mk/spec/x86/kernel-okl4-include.mk similarity index 86% rename from repos/base-okl4/lib/mk/spec/x86/kernel.mk rename to repos/base-okl4/lib/mk/spec/x86/kernel-okl4-include.mk index beb9635a95..23796b206c 100644 --- a/repos/base-okl4/lib/mk/spec/x86/kernel.mk +++ b/repos/base-okl4/lib/mk/spec/x86/kernel-okl4-include.mk @@ -1,4 +1,3 @@ -OKL4_BUILD_DIR = $(BUILD_BASE_DIR)/kernel OKL4_SRC_DIR = $(call select_from_ports,okl4)/src/kernel/okl4 ARCH_DIR = $(OKL4_SRC_DIR)/arch/ia32 PLAT_DIR = $(OKL4_SRC_DIR)/platform/pc99 @@ -90,23 +89,23 @@ INC_SYMLINKS = arch/apic.h \ plat/nmi.h \ plat/rtc.h -include $(REP_DIR)/lib/mk/kernel.inc +include $(REP_DIR)/lib/mk/kernel-okl4-include.inc -$(OKL4_BUILD_DIR)/include/atomic_ops/arch/%.h: $(ARCH_DIR)/libs/atomic_ops/include/%.h +include/atomic_ops/arch/%.h: $(ARCH_DIR)/libs/atomic_ops/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/l4/arch/%.h: $(ARCH_DIR)/libs/l4/include/%.h +include/l4/arch/%.h: $(ARCH_DIR)/libs/l4/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/kernel/arch/%.h: $(ARCH_DIR)/pistachio/include/%.h +include/kernel/arch/%.h: $(ARCH_DIR)/pistachio/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/arch/%.h: $(ARCH_DIR)/pistachio/include/%.h +include/arch/%.h: $(ARCH_DIR)/pistachio/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/cpu/%.h: $(ARCH_DIR)/pistachio/cpu/idt/include/%.h +include/cpu/%.h: $(ARCH_DIR)/pistachio/cpu/idt/include/%.h $(VERBOSE)ln -s $< $@ -$(OKL4_BUILD_DIR)/include/plat/%.h: $(PLAT_DIR)/pistachio/include/%.h +include/plat/%.h: $(PLAT_DIR)/pistachio/include/%.h $(VERBOSE)ln -s $< $@ diff --git a/repos/base-okl4/src/kernel/spec/x86/target.mk b/repos/base-okl4/lib/mk/spec/x86/kernel-okl4.mk similarity index 93% rename from repos/base-okl4/src/kernel/spec/x86/target.mk rename to repos/base-okl4/lib/mk/spec/x86/kernel-okl4.mk index dc6bd4b843..bafba103ca 100644 --- a/repos/base-okl4/src/kernel/spec/x86/target.mk +++ b/repos/base-okl4/lib/mk/spec/x86/kernel-okl4.mk @@ -1,4 +1,5 @@ -REQUIRES = x86 32bit +OKL4_SRC_DIR = $(call select_from_ports,okl4)/src/kernel/okl4 + CONFIG = ARCH_IA32 \ CONFIG_ARCH_IA32=1 \ CONFIG_CPU_IA32_I686 \ @@ -43,12 +44,12 @@ SRC_SPP = arch/ia32/pistachio/src/trap.spp \ arch/ia32/pistachio/src/gnu/bootmem-elf.spp \ platform/pc99/pistachio/src/smp.spp \ platform/pc99/pistachio/src/startup.spp -LD_TEXT_ADDR = 0xf0100000 +LD_TEXT_ADDR := 0xf0100000 --include $(REP_DIR)/src/kernel/target.inc +-include $(REP_DIR)/lib/mk/kernel-okl4.inc LD_SCRIPT_STATIC = $(REP_DIR)/contrib/generated/x86/linker.ld -INC_DIR = $(OKL4_BUILD_DIR)/include \ +INC_DIR = include \ $(REP_DIR)/contrib/generated/x86 \ $(OKL4_SRC_DIR)/pistachio/include diff --git a/repos/base-okl4/lib/mk/spec/x86/platform.mk b/repos/base-okl4/lib/mk/spec/x86/platform.mk deleted file mode 100644 index 577b721b49..0000000000 --- a/repos/base-okl4/lib/mk/spec/x86/platform.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Create prerequisites for building Genode for OKL4 -# -# Prior building Genode programs for OKL4, the kernel bindings needed are -# symlinked to the build directory. -# - -# -# Create mirror for architecture-specific L4 header files -# -OKL4_INCLUDE_SYMLINKS = $(BUILD_BASE_DIR)/include/l4/arch - -include $(REP_DIR)/lib/mk/platform.inc - -$(BUILD_BASE_DIR)/include/l4/arch: $(OKL4_DIR)/arch/ia32/libs/l4/include - $(VERBOSE)ln -sf $< $@ diff --git a/repos/base-okl4/lib/mk/spec/x86/syscall-okl4.mk b/repos/base-okl4/lib/mk/spec/x86/syscall-okl4.mk new file mode 100644 index 0000000000..62fb830ad9 --- /dev/null +++ b/repos/base-okl4/lib/mk/spec/x86/syscall-okl4.mk @@ -0,0 +1,9 @@ +# +# Create mirror for architecture-specific L4 header files +# +OKL4_INCLUDE_SYMLINKS = include/l4/arch + +include $(REP_DIR)/lib/mk/syscall-okl4.inc + +include/l4/arch: $(OKL4_DIR)/arch/ia32/libs/l4/include + $(VERBOSE)ln -sf $< $@ diff --git a/repos/base-okl4/lib/mk/spec/x86_32/startup-okl4.mk b/repos/base-okl4/lib/mk/spec/x86_32/startup-okl4.mk new file mode 100644 index 0000000000..cca09db60e --- /dev/null +++ b/repos/base-okl4/lib/mk/spec/x86_32/startup-okl4.mk @@ -0,0 +1,3 @@ +LIBS += syscall-okl4 + +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc diff --git a/repos/base-okl4/lib/mk/startup-okl4.mk b/repos/base-okl4/lib/mk/startup-okl4.mk new file mode 100644 index 0000000000..39e14e7641 --- /dev/null +++ b/repos/base-okl4/lib/mk/startup-okl4.mk @@ -0,0 +1,5 @@ +LIBS += syscall-okl4 + +include $(BASE_DIR)/lib/mk/startup.inc + +vpath crt0.s $(BASE_DIR)/src/lib/startup/spec/x86_32 diff --git a/repos/base-okl4/lib/mk/platform.inc b/repos/base-okl4/lib/mk/syscall-okl4.inc similarity index 76% rename from repos/base-okl4/lib/mk/platform.inc rename to repos/base-okl4/lib/mk/syscall-okl4.inc index 32b026a1ca..2a3e0cc511 100644 --- a/repos/base-okl4/lib/mk/platform.inc +++ b/repos/base-okl4/lib/mk/syscall-okl4.inc @@ -1,16 +1,11 @@ -# -# Create prerequisites for building Genode for OKL4 -# -# Prior building Genode programs for OKL4, the kernel bindings needed are -# symlinked to the build directory. -# - # # Execute the rules in this file only at the second build stage when we know # about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'. # ifeq ($(called_from_lib_mk),yes) +include $(REP_DIR)/lib/import/import-syscall-okl4.mk + # # Make OKL4 kernel API headers available to the Genode build system # @@ -25,8 +20,8 @@ OKL4_L4_INCLUDES = arch.h cache.h caps.h config.h interrupt.h ipc.h kdebug.h \ pagefault.h procdesc.h profile.h schedule.h security.h \ space.h thread.h time.h types.h utcb.h -OKL4_INCLUDE_SYMLINKS += $(addprefix $(BUILD_BASE_DIR)/include/l4/,$(OKL4_L4_INCLUDES)) -OKL4_INCLUDE_SYMLINKS += $(addprefix $(BUILD_BASE_DIR)/include/,compat bootinfo) +OKL4_INCLUDE_SYMLINKS += $(addprefix include/l4/,$(OKL4_L4_INCLUDES)) +OKL4_INCLUDE_SYMLINKS += $(addprefix include/,compat bootinfo) OKL4_INCLUDE_DIRS = $(sort $(dir $(OKL4_INCLUDE_SYMLINKS))) @@ -45,13 +40,13 @@ $(OKL4_DIR): $(OKL4_DIR)/%: $(filter-out $(wildcard $(OKL4_DIR)), $(OKL4_DIR)) -$(BUILD_BASE_DIR)/include/l4/%.h: $(OKL4_DIR)/libs/l4/include/%.h +include/l4/%.h: $(OKL4_DIR)/libs/l4/include/%.h $(VERBOSE)ln -sf $< $@ -$(BUILD_BASE_DIR)/include/compat: $(OKL4_DIR)/libs/compat/include/compat +include/compat: $(OKL4_DIR)/libs/compat/include/compat $(VERBOSE)ln -sf $< $@ -$(BUILD_BASE_DIR)/include/bootinfo: $(OKL4_DIR)/libs/bootinfo/include +include/bootinfo: $(OKL4_DIR)/libs/bootinfo/include $(VERBOSE)ln -sf $< $@ endif diff --git a/repos/base-okl4/mk/spec/okl4.mk b/repos/base-okl4/mk/spec/okl4.mk deleted file mode 100644 index 0770a7bf01..0000000000 --- a/repos/base-okl4/mk/spec/okl4.mk +++ /dev/null @@ -1,53 +0,0 @@ -# -# Specifics for the OKL4 kernel API -# - -# -# Read default and builddir-specific config files -# --include $(call select_from_repositories,etc/okl4.conf) --include $(BUILD_BASE_DIR)/etc/okl4.conf - -# -# If no OKL4 source directory is set, we use the standard contrib directory. -# We do this with ifeq and := as ?= would be done lazy. Forcing the -# evaluation of $(call select_from_ports,okl4) ensures that the kernel -# port, if missing, is added to the missing-ports list of the first build -# stage. -# -ifeq ($(OKL4_DIR),) -OKL4_DIR := $(call select_from_ports,okl4)/src/kernel/okl4 -endif - -# -# Make sure that symlink modification times are handled correctly. -# Otherwise, the creation of symlinks that depend on their own directory -# behaves like a phony rule. This is because the directory mtime is -# determined by taking the mtimes of containing symlinks into account. -# Hence, all symlinks (except for the youngest) depend on a directory -# with a newer mtime. The make flag -L fixes the problem. Alternatively, -# we could use 'cp' instead of 'ln'. -# -MAKEFLAGS += -L - -# -# OKL4-specific Genode headers -# -INC_DIR += $(BUILD_BASE_DIR)/include - -# -# Define maximum number of threads, needed by the OKL4 kernel headers -# -CC_OPT += -DCONFIG_MAX_THREAD_BITS=10 - -# -# Clean rules for removing the side effects of building the platform -# library -# -clean_includes: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/include - -clean_tool_elfweaver: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/tool/okl4/elfweaver - -clean cleanall: clean_includes clean_tool_elfweaver diff --git a/repos/base-okl4/mk/spec/okl4_x86.mk b/repos/base-okl4/mk/spec/okl4_x86.mk deleted file mode 100644 index 86eac58aa4..0000000000 --- a/repos/base-okl4/mk/spec/okl4_x86.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -# Specifics for OKL4 on x86 -# - -SPECS += x86_32 okl4 -SPECS += pci ps2 vesa framebuffer - -# -# Also include less-specific configuration last -# -include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/okl4.mk) diff --git a/repos/base-okl4/src/core/okl4/target.mk b/repos/base-okl4/src/core/okl4/target.mk new file mode 100644 index 0000000000..5cc8f1d3bf --- /dev/null +++ b/repos/base-okl4/src/core/okl4/target.mk @@ -0,0 +1,3 @@ +LIBS = core-okl4 + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-okl4/src/kernel/okl4/target.mk b/repos/base-okl4/src/kernel/okl4/target.mk new file mode 100644 index 0000000000..ec5cc13c5c --- /dev/null +++ b/repos/base-okl4/src/kernel/okl4/target.mk @@ -0,0 +1,11 @@ +TARGET = okl4 +LIBS = kernel-okl4 +SRC_C = dummy.c + +LD_TEXT_ADDR := 0xf0100000 +LD_SCRIPT_STATIC = $(REP_DIR)/contrib/generated/x86/linker.ld + +$(TARGET): dummy.c + +dummy.c: + @touch $@ diff --git a/repos/base-pistachio/doc/pistachio.txt b/repos/base-pistachio/doc/pistachio.txt index eaa7dcf915..3f3ec6e51d 100644 --- a/repos/base-pistachio/doc/pistachio.txt +++ b/repos/base-pistachio/doc/pistachio.txt @@ -64,22 +64,5 @@ This command will execute the steps described in the run script located at scenario, create a configuration, and start the scenario using Qemu. To inspect the individual steps more closely or learn the steps needed to manually integrate Genode with L4ka::Pistachio, please revisit the Pistachio-specific -run environment at 'base-pistachio/run/env'. - - -Using an externally supplied kernel -################################### - -It is possible to use a L4ka::Pistachio kernel that is manually downloaded -and built. To let Genode use an external kernel, create a file called -'/etc/pistachio.conf' with the following declarations: - -! PISTACHIO_USER_BUILD_DIR = - -The location of the Pistachio user-level build directory is the place where -Genode looks for the kernel-interface header files and the system bindings. - -! PISTACHIO_KERNEL = - -The specified kernel binary will be used when executing run scripts. +run environment at 'tool/run/boot_dir/pistachio'. diff --git a/repos/base-pistachio/etc/specs.conf b/repos/base-pistachio/etc/specs.conf index f426787dab..9b6966ecc8 100644 --- a/repos/base-pistachio/etc/specs.conf +++ b/repos/base-pistachio/etc/specs.conf @@ -1 +1 @@ -SPECS = genode pistachio_x86 +SPECS += genode pistachio x86_32 vesa pci ps2 framebuffer diff --git a/repos/base-pistachio/lib/import/import-syscall-pistachio.mk b/repos/base-pistachio/lib/import/import-syscall-pistachio.mk new file mode 100644 index 0000000000..a44ed3ba13 --- /dev/null +++ b/repos/base-pistachio/lib/import/import-syscall-pistachio.mk @@ -0,0 +1 @@ +INC_DIR += $(LIB_CACHE_DIR)/syscall-pistachio/include diff --git a/repos/base-pistachio/lib/mk/base-pistachio-common.mk b/repos/base-pistachio/lib/mk/base-pistachio-common.mk index 28a975ee34..7aa17aaa84 100644 --- a/repos/base-pistachio/lib/mk/base-pistachio-common.mk +++ b/repos/base-pistachio/lib/mk/base-pistachio-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += startup syscall +LIBS += startup-pistachio syscall-pistachio SRC_CC += capability.cc capability_raw.cc SRC_CC += signal_submit.cc diff --git a/repos/base-pistachio/lib/mk/base-pistachio.mk b/repos/base-pistachio/lib/mk/base-pistachio.mk index 2dfbeaa26d..9525cbb503 100644 --- a/repos/base-pistachio/lib/mk/base-pistachio.mk +++ b/repos/base-pistachio/lib/mk/base-pistachio.mk @@ -1,6 +1,7 @@ include $(BASE_DIR)/lib/mk/base.inc -LIBS += base-pistachio-common +LIBS += base-pistachio-common syscall-pistachio + SRC_CC += thread_start.cc SRC_CC += cache.cc SRC_CC += capability_space.cc diff --git a/repos/base-pistachio/lib/mk/core.inc b/repos/base-pistachio/lib/mk/core-pistachio.inc similarity index 97% rename from repos/base-pistachio/lib/mk/core.inc rename to repos/base-pistachio/lib/mk/core-pistachio.inc index 10e7913868..681f34587f 100644 --- a/repos/base-pistachio/lib/mk/core.inc +++ b/repos/base-pistachio/lib/mk/core-pistachio.inc @@ -1,5 +1,4 @@ -REQUIRES = pistachio -LIBS = base-pistachio-common +LIBS = base-pistachio-common syscall-pistachio GEN_CORE_DIR = $(BASE_DIR)/src/core diff --git a/repos/base-pistachio/lib/mk/platform.mk b/repos/base-pistachio/lib/mk/platform.mk deleted file mode 100644 index 82bcf24ae1..0000000000 --- a/repos/base-pistachio/lib/mk/platform.mk +++ /dev/null @@ -1,26 +0,0 @@ -# -# Create prerequisites for building Genode for Pistachio -# - -# -# Execute the rules in this file only at the second build stage when we know -# about the complete build settings, e.g., the 'CROSS_DEV_PREFIX'. -# -ifeq ($(called_from_lib_mk),yes) - -all: $(filter-out $(wildcard $(PISTACHIO_USER_BUILD_DIR)), $(PISTACHIO_USER_BUILD_DIR)) - -LD_PREFIX = "-Wl," -PISTACHIO_CONTRIB_DIR := $(call select_from_ports,pistachio)/src/kernel/pistachio - -$(PISTACHIO_USER_BUILD_DIR): - $(VERBOSE)mkdir $@ - $(VERBOSE)cd $@; \ - LIBGCCFLAGS="$(CC_MARCH)" \ - LDFLAGS="$(addprefix $(LD_PREFIX),$(LD_MARCH)) -nostdlib" \ - CFLAGS="$(CC_MARCH)" \ - $(PISTACHIO_CONTRIB_DIR)/user/configure --build=ia32 --host i686 \ - CC=$(CROSS_DEV_PREFIX)gcc - $(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $@ - -endif diff --git a/repos/base-pistachio/lib/mk/spec/x86/core.mk b/repos/base-pistachio/lib/mk/spec/x86_32/core-pistachio.mk similarity index 60% rename from repos/base-pistachio/lib/mk/spec/x86/core.mk rename to repos/base-pistachio/lib/mk/spec/x86_32/core-pistachio.mk index 6cb90885b5..be5b43f4de 100644 --- a/repos/base-pistachio/lib/mk/spec/x86/core.mk +++ b/repos/base-pistachio/lib/mk/spec/x86_32/core-pistachio.mk @@ -1,9 +1,8 @@ -include $(REP_DIR)/lib/mk/core.inc +include $(REP_DIR)/lib/mk/core-pistachio.inc -REQUIRES += x86 -SRC_CC += io_port_session_component.cc \ - io_port_session_support.cc \ - platform_x86.cc +SRC_CC += io_port_session_component.cc \ + io_port_session_support.cc \ + platform_x86.cc vpath io_port_session_component.cc $(GEN_CORE_DIR)/spec/x86 vpath io_port_session_support.cc $(GEN_CORE_DIR)/spec/x86 diff --git a/repos/base-pistachio/lib/mk/spec/x86_32/startup-pistachio.mk b/repos/base-pistachio/lib/mk/spec/x86_32/startup-pistachio.mk new file mode 100644 index 0000000000..768cc26ac7 --- /dev/null +++ b/repos/base-pistachio/lib/mk/spec/x86_32/startup-pistachio.mk @@ -0,0 +1,3 @@ +include $(BASE_DIR)/lib/mk/spec/x86_32/startup.inc + +LIBS += syscall-pistachio diff --git a/repos/base-pistachio/lib/mk/syscall-pistachio.mk b/repos/base-pistachio/lib/mk/syscall-pistachio.mk new file mode 100644 index 0000000000..787b3bb5ba --- /dev/null +++ b/repos/base-pistachio/lib/mk/syscall-pistachio.mk @@ -0,0 +1,24 @@ +PISTACHIO_CONTRIB_DIR := $(call select_from_ports,pistachio)/src/kernel/pistachio +PISTACHIO_USER_SRC := $(PISTACHIO_CONTRIB_DIR)/user/lib/l4 + +LD_PREFIX := "-Wl," + +CC_WARN += -Wno-array-bounds -Wno-unused-but-set-variable \ + -Wno-parentheses -Wno-format + +user_build.tag: + LIBGCCFLAGS="$(CC_MARCH)" \ + LDFLAGS="$(addprefix $(LD_PREFIX),$(LD_MARCH)) -nostdlib" \ + CFLAGS="$(CC_MARCH) $(CC_WARN)" \ + $(PISTACHIO_CONTRIB_DIR)/user/configure --build=ia32 --host i686 \ + CC=$(CROSS_DEV_PREFIX)gcc + $(VERBOSE_MK) MAKEFLAGS= $(MAKE) -s $(VERBOSE_DIR) + @touch $@ + +SRC_CC := debug.cc ia32.cc +SRC_S := ia32-syscall-stubs.S +CC_OPT += -Iinclude + +$(SRC_CC:.cc=.o) $(SRC_S:.S:.o): user_build.tag + +vpath % $(PISTACHIO_USER_SRC) diff --git a/repos/base-pistachio/lib/mk/syscall.mk b/repos/base-pistachio/lib/mk/syscall.mk deleted file mode 100644 index ebc5bf5e74..0000000000 --- a/repos/base-pistachio/lib/mk/syscall.mk +++ /dev/null @@ -1,7 +0,0 @@ -PISTACHIO_USER_SRC := $(call select_from_ports,pistachio)/src/kernel/pistachio/user/lib/l4 - -SRC_CC = debug.cc ia32.cc -SRC_S = ia32-syscall-stubs.S - -vpath %.cc $(PISTACHIO_USER_SRC) -vpath %.S $(PISTACHIO_USER_SRC) diff --git a/repos/base-pistachio/mk/spec/pistachio.mk b/repos/base-pistachio/mk/spec/pistachio.mk deleted file mode 100644 index b333db0339..0000000000 --- a/repos/base-pistachio/mk/spec/pistachio.mk +++ /dev/null @@ -1,29 +0,0 @@ -# -# Specifics for the pistachio kernel API -# - -# -# Read default and builddir-specific config files -# -# In these config files, we expect to find the definition of PISTACHIO_USER_BUILD_DIR -# --include $(call select_from_repositories,etc/pistachio.conf) --include $(BUILD_BASE_DIR)/etc/pistachio.conf - -PISTACHIO_USER_BUILD_DIR ?= $(BUILD_BASE_DIR)/l4 - -# -# Pistachio headers -# -INC_DIR += $(PISTACHIO_USER_BUILD_DIR)/include - -# -# Pistachio-specific Genode headers -# -REP_INC_DIR += include/pistachio - -clean_contrib: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/l4 - -cleanall: clean_contrib - diff --git a/repos/base-pistachio/mk/spec/pistachio_x86.mk b/repos/base-pistachio/mk/spec/pistachio_x86.mk deleted file mode 100644 index 2b84547a34..0000000000 --- a/repos/base-pistachio/mk/spec/pistachio_x86.mk +++ /dev/null @@ -1,9 +0,0 @@ -# -# Specifics for Pistachio on 32-bit x86 -# - -SPECS += x86_32 pistachio -SPECS += pci ps2 vesa framebuffer - -include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/pistachio.mk) diff --git a/repos/base-pistachio/src/core/pistachio/target.mk b/repos/base-pistachio/src/core/pistachio/target.mk new file mode 100644 index 0000000000..f000d84043 --- /dev/null +++ b/repos/base-pistachio/src/core/pistachio/target.mk @@ -0,0 +1,3 @@ +LIBS = core-pistachio + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-pistachio/src/kernel/target.mk b/repos/base-pistachio/src/kernel/pistachio/target.mk similarity index 64% rename from repos/base-pistachio/src/kernel/target.mk rename to repos/base-pistachio/src/kernel/pistachio/target.mk index 453bfca9c7..38d9287acf 100644 --- a/repos/base-pistachio/src/kernel/target.mk +++ b/repos/base-pistachio/src/kernel/pistachio/target.mk @@ -1,15 +1,18 @@ TARGET = kernel REQUIRES += pistachio -KERNEL_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/pistachio -KERNEL = $(KERNEL_BUILD_DIR)/x86-kernel +KERNEL_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/pistachio/build KERNEL_SRC := $(call select_from_ports,pistachio)/src/kernel/pistachio/kernel LIBGCC_DIR = $(dir $(shell $(CC) $(CC_MARCH) -print-libgcc-file-name)) GCCINC_DIR = $(dir $(shell $(CC) -print-libgcc-file-name))include -$(TARGET): $(KERNEL) +KERNEL_CCFLAGS := $(CC_MARCH) +KERNEL_CCFLAGS += -Wno-unused-function -Wno-array-bounds -Wno-narrowing \ + -Wno-unused-but-set-variable -Wno-maybe-uninitialized \ + -Wno-unused-variable -.PHONY: $(KERNEL) +$(TARGET): $(KERNEL_BUILD_DIR)/x86-kernel + $(VERBOSE)ln -sf $< $@ $(KERNEL_BUILD_DIR)/Makefile: $(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(KERNEL_SRC) BUILDDIR=$(dir $@) @@ -43,18 +46,33 @@ $(KERNEL_BUILD_DIR)/Makefile: # $(KERNEL_BUILD_DIR)/config/.config: $(KERNEL_BUILD_DIR)/Makefile - $(VERBOSE_MK)CCFLAGS="$(CC_MARCH)" MAKEFLAGS= \ - $(MAKE) $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) batchconfig \ + $(VERBOSE_MK)CCFLAGS="$(KERNEL_CCFLAGS)" MAKEFLAGS=-s \ + $(MAKE) -s $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) batchconfig \ GCCINSTALLDIR=$(LIBGCC_DIR) -$(KERNEL): $(KERNEL_BUILD_DIR)/config/.config - $(VERBOSE_MK)CCFLAGS="$(CC_MARCH)" LDFLAGS="$(LD_MARCH)" ASMFLAGS="$(CC_MARCH)" MAKEFLAGS= \ - $(MAKE) $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) \ +$(KERNEL_BUILD_DIR)/x86-kernel: $(KERNEL_BUILD_DIR)/config/.config + $(VERBOSE_MK)CCFLAGS="$(KERNEL_CCFLAGS)" LDFLAGS="$(LD_MARCH)" \ + ASMFLAGS="$(CC_MARCH)" MAKEFLAGS= \ + $(MAKE) -s $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) \ TOOLPREFIX=$(CROSS_DEV_PREFIX) \ GCCINSTALLDIR=$(LIBGCC_DIR) \ LIBGCCINC=$(GCCINC_DIR) - $(VERBOSE)ln -sf $@ $(BUILD_BASE_DIR)/bin/$(TARGET) - $(VERBOSE)touch $@ clean cleanall: $(VERBOSE)rm -rf $(KERNEL_BUILD_DIR) + +# +# Install symlinks for sigma0 and kickstart at kernel/pistachio/ +# +# The 'LIBS' dependency ensures that the Pistachio userland is built before. +# +LIBS += syscall-pistachio + +$(TARGET): sigma0 kickstart + +sigma0: + $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/syscall-pistachio/serv/sigma0/sigma0 + +kickstart: + $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/syscall-pistachio/util/kickstart/kickstart + diff --git a/repos/base-sel4/etc/specs.conf b/repos/base-sel4/etc/specs.conf new file mode 100644 index 0000000000..adfa3ddba5 --- /dev/null +++ b/repos/base-sel4/etc/specs.conf @@ -0,0 +1 @@ +SPECS += genode sel4 vesa acpi pci ps2 framebuffer diff --git a/repos/base-sel4/lib/import/import-syscall-sel4.mk b/repos/base-sel4/lib/import/import-syscall-sel4.mk new file mode 100644 index 0000000000..bf94fa91a6 --- /dev/null +++ b/repos/base-sel4/lib/import/import-syscall-sel4.mk @@ -0,0 +1,15 @@ +SEL4_INCLUDE_DIR := $(LIB_CACHE_DIR)/syscall-sel4/include + +# +# Access kernel-interface headers that were installed when building the +# syscall-sel4 library. +# +INC_DIR += $(SEL4_INCLUDE_DIR) + +# +# Access to other sel4-specific headers such as 'autoconf.h'. +# +INC_DIR += $(SEL4_INCLUDE_DIR)/sel4 + +# required for seL4_DebugPutChar +CC_OPT += -DSEL4_DEBUG_KERNEL -DDEBUG diff --git a/repos/base-sel4/lib/import/import-syscall.mk b/repos/base-sel4/lib/import/import-syscall.mk deleted file mode 100644 index f86cdb385d..0000000000 --- a/repos/base-sel4/lib/import/import-syscall.mk +++ /dev/null @@ -1,13 +0,0 @@ -# -# Access to kernel-interface headers that were installed in the build directory -# when building the platform library. -# -INC_DIR += $(BUILD_BASE_DIR)/include - -# -# Access to other sel4-specific headers such as 'autoconf.h'. -# -INC_DIR += $(BUILD_BASE_DIR)/include/sel4 - -# required for seL4_DebugPutChar -CC_OPT += -DSEL4_DEBUG_KERNEL -DDEBUG diff --git a/repos/base-sel4/lib/mk/base-sel4-common.mk b/repos/base-sel4/lib/mk/base-sel4-common.mk index 3bf9e2a489..b1fefb1719 100644 --- a/repos/base-sel4/lib/mk/base-sel4-common.mk +++ b/repos/base-sel4/lib/mk/base-sel4-common.mk @@ -6,7 +6,7 @@ include $(BASE_DIR)/lib/mk/base-common.inc -LIBS += startup syscall +LIBS += startup-sel4 syscall-sel4 SRC_CC += signal_submit.cc SRC_CC += rpc_dispatch_loop.cc diff --git a/repos/base-sel4/lib/mk/base-sel4.mk b/repos/base-sel4/lib/mk/base-sel4.mk index 22d17998d7..e9faa7f355 100644 --- a/repos/base-sel4/lib/mk/base-sel4.mk +++ b/repos/base-sel4/lib/mk/base-sel4.mk @@ -4,4 +4,4 @@ SRC_CC += capability_space.cc SRC_CC += thread_start.cc thread_init.cc SRC_CC += cache.cc -LIBS += syscall base-sel4-common +LIBS += syscall-sel4 base-sel4-common diff --git a/repos/base-sel4/lib/mk/core.mk b/repos/base-sel4/lib/mk/core-sel4.mk similarity index 57% rename from repos/base-sel4/lib/mk/core.mk rename to repos/base-sel4/lib/mk/core-sel4.mk index cbf34386e4..4530896513 100644 --- a/repos/base-sel4/lib/mk/core.mk +++ b/repos/base-sel4/lib/mk/core-sel4.mk @@ -30,35 +30,38 @@ SRC_CC += \ core_region_map.cc \ core_mem_alloc.cc \ core_rpc_cap_alloc.cc \ + core_log.cc default_log.cc \ dump_alloc.cc \ stack_area.cc \ capability_space.cc \ pager.cc -LIBS += core_log base-sel4-common syscall +LIBS += base-sel4-common syscall-sel4 INC_DIR += $(REP_DIR)/src/core/include $(GEN_CORE_DIR)/include \ $(REP_DIR)/src/include $(BASE_DIR)/src/include include $(GEN_CORE_DIR)/version.inc -vpath main.cc $(GEN_CORE_DIR) -vpath ram_session_component.cc $(GEN_CORE_DIR) -vpath rom_session_component.cc $(GEN_CORE_DIR) -vpath cpu_session_component.cc $(GEN_CORE_DIR) -vpath cpu_session_support.cc $(GEN_CORE_DIR) -vpath cpu_thread_component.cc $(GEN_CORE_DIR) -vpath pd_session_component.cc $(GEN_CORE_DIR) -vpath pd_assign_pci.cc $(GEN_CORE_DIR) -vpath pd_upgrade_ram_quota.cc $(GEN_CORE_DIR) -vpath region_map_component.cc $(GEN_CORE_DIR) -vpath io_mem_session_component.cc $(GEN_CORE_DIR) -vpath io_mem_session_support.cc $(GEN_CORE_DIR) +vpath main.cc $(GEN_CORE_DIR) +vpath ram_session_component.cc $(GEN_CORE_DIR) +vpath rom_session_component.cc $(GEN_CORE_DIR) +vpath cpu_session_component.cc $(GEN_CORE_DIR) +vpath cpu_session_support.cc $(GEN_CORE_DIR) +vpath cpu_thread_component.cc $(GEN_CORE_DIR) +vpath pd_session_component.cc $(GEN_CORE_DIR) +vpath pd_assign_pci.cc $(GEN_CORE_DIR) +vpath pd_upgrade_ram_quota.cc $(GEN_CORE_DIR) +vpath region_map_component.cc $(GEN_CORE_DIR) +vpath io_mem_session_component.cc $(GEN_CORE_DIR) +vpath io_mem_session_support.cc $(GEN_CORE_DIR) vpath io_port_session_component.cc $(GEN_CORE_DIR)/spec/x86 -vpath platform_services.cc $(GEN_CORE_DIR)/spec/x86 -vpath trace_session_component.cc $(GEN_CORE_DIR) -vpath dataspace_component.cc $(GEN_CORE_DIR) -vpath core_mem_alloc.cc $(GEN_CORE_DIR) -vpath core_rpc_cap_alloc.cc $(GEN_CORE_DIR) -vpath dump_alloc.cc $(GEN_CORE_DIR) -vpath %.cc $(REP_DIR)/src/core +vpath platform_services.cc $(GEN_CORE_DIR)/spec/x86 +vpath trace_session_component.cc $(GEN_CORE_DIR) +vpath dataspace_component.cc $(GEN_CORE_DIR) +vpath core_mem_alloc.cc $(GEN_CORE_DIR) +vpath core_rpc_cap_alloc.cc $(GEN_CORE_DIR) +vpath dump_alloc.cc $(GEN_CORE_DIR) +vpath default_log.cc $(GEN_CORE_DIR) +vpath %.cc $(REP_DIR)/src/core + diff --git a/repos/base-sel4/lib/mk/core_log.mk b/repos/base-sel4/lib/mk/core_log.mk deleted file mode 100644 index 3bfb458da7..0000000000 --- a/repos/base-sel4/lib/mk/core_log.mk +++ /dev/null @@ -1,6 +0,0 @@ -SRC_CC = core_log.cc default_log.cc -INC_DIR += $(REP_DIR)/src/include $(BASE_DIR)/src/include $(BASE_DIR)/src/core/include -LIBS += syscall - -vpath core_log.cc $(REP_DIR)/src/core -vpath default_log.cc $(BASE_DIR)/src/core diff --git a/repos/base-sel4/lib/mk/spec/x86_32/kernel.mk b/repos/base-sel4/lib/mk/spec/x86_32/kernel-sel4.mk similarity index 100% rename from repos/base-sel4/lib/mk/spec/x86_32/kernel.mk rename to repos/base-sel4/lib/mk/spec/x86_32/kernel-sel4.mk diff --git a/repos/base-sel4/lib/mk/spec/x86_32/startup.mk b/repos/base-sel4/lib/mk/spec/x86_32/startup-sel4.mk similarity index 94% rename from repos/base-sel4/lib/mk/spec/x86_32/startup.mk rename to repos/base-sel4/lib/mk/spec/x86_32/startup-sel4.mk index 5b76cbfba5..0df2e61017 100644 --- a/repos/base-sel4/lib/mk/spec/x86_32/startup.mk +++ b/repos/base-sel4/lib/mk/spec/x86_32/startup-sel4.mk @@ -5,6 +5,8 @@ # INC_DIR += $(REP_DIR)/src/include $(BASE_DIR)/src/include +LIBS += syscall-sel4 + include $(BASE_DIR)/lib/mk/startup.inc vpath crt0.s $(BASE_DIR)/src/lib/startup/spec/x86_32 diff --git a/repos/base-sel4/lib/mk/spec/x86_32/platform.mk b/repos/base-sel4/lib/mk/spec/x86_32/syscall-sel4.mk similarity index 70% rename from repos/base-sel4/lib/mk/spec/x86_32/platform.mk rename to repos/base-sel4/lib/mk/spec/x86_32/syscall-sel4.mk index f24b91a4e9..0c938ecbbf 100644 --- a/repos/base-sel4/lib/mk/spec/x86_32/platform.mk +++ b/repos/base-sel4/lib/mk/spec/x86_32/syscall-sel4.mk @@ -36,66 +36,66 @@ INCLUDES := objecttype.h types.h bootinfo.h bootinfo_types.h errors.h constants. invocation.h shared_types_gen.h debug_assert.h shared_types.h \ sel4.h deprecated.h autoconf.h -INCLUDE_SYMLINKS += $(addprefix $(BUILD_BASE_DIR)/include/sel4/, $(INCLUDES)) -INCLUDE_SYMLINKS += $(addprefix $(BUILD_BASE_DIR)/include/sel4/arch/, $(ARCH_INCLUDES)) -INCLUDE_SYMLINKS += $(addprefix $(BUILD_BASE_DIR)/include/sel4/sel4_arch/,$(SEL4_ARCH_INCLUDES)) -INCLUDE_SYMLINKS += $(BUILD_BASE_DIR)/include/interfaces/sel4_client.h +INCLUDE_SYMLINKS += $(addprefix include/sel4/, $(INCLUDES)) +INCLUDE_SYMLINKS += $(addprefix include/sel4/arch/, $(ARCH_INCLUDES)) +INCLUDE_SYMLINKS += $(addprefix include/sel4/sel4_arch/,$(SEL4_ARCH_INCLUDES)) +INCLUDE_SYMLINKS += include/interfaces/sel4_client.h all: $(INCLUDE_SYMLINKS) # # Plain symlinks to existing headers # -$(BUILD_BASE_DIR)/include/sel4/sel4_arch/%.h: $(LIBSEL4_DIR)/sel4_arch_include/ia32/sel4/sel4_arch/%.h +include/sel4/sel4_arch/%.h: $(LIBSEL4_DIR)/sel4_arch_include/ia32/sel4/sel4_arch/%.h $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)ln -sf $< $@ -$(BUILD_BASE_DIR)/include/sel4/arch/%.h: $(LIBSEL4_DIR)/arch_include/x86/sel4/arch/%.h +include/sel4/arch/%.h: $(LIBSEL4_DIR)/arch_include/x86/sel4/arch/%.h $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)ln -sf $< $@ -$(BUILD_BASE_DIR)/include/sel4/autoconf.h: $(LIBSEL4_AUTO)/autoconf.h +include/sel4/autoconf.h: $(LIBSEL4_AUTO)/autoconf.h $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)ln -sf $< $@ -$(BUILD_BASE_DIR)/include/sel4/%.h: $(LIBSEL4_DIR)/include/sel4/%.h +include/sel4/%.h: $(LIBSEL4_DIR)/include/sel4/%.h $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)ln -sf $< $@ # # Generated headers # -$(BUILD_BASE_DIR)/include/sel4/types_gen.h: $(LIBSEL4_DIR)/include/sel4/types_32.bf +include/sel4/types_gen.h: $(LIBSEL4_DIR)/include/sel4/types_32.bf $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/bitfield_gen.py \ --environment libsel4 "$<" $@ -$(BUILD_BASE_DIR)/include/sel4/shared_types_gen.h: $(LIBSEL4_DIR)/include/sel4/shared_types_32.bf +include/sel4/shared_types_gen.h: $(LIBSEL4_DIR)/include/sel4/shared_types_32.bf $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/bitfield_gen.py \ --environment libsel4 "$<" $@ -$(BUILD_BASE_DIR)/include/sel4/syscall.h: $(LIBSEL4_DIR)/include/api/syscall.xml +include/sel4/syscall.h: $(LIBSEL4_DIR)/include/api/syscall.xml $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/syscall_header_gen.py \ --xml $< --libsel4_header $@ -$(BUILD_BASE_DIR)/include/sel4/invocation.h: $(LIBSEL4_DIR)/include/interfaces/sel4.xml +include/sel4/invocation.h: $(LIBSEL4_DIR)/include/interfaces/sel4.xml $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/invocation_header_gen.py \ --xml $< --libsel4 --dest $@ -$(BUILD_BASE_DIR)/include/sel4/sel4_arch/invocation.h: $(LIBSEL4_DIR)/sel4_arch_include/ia32/interfaces/sel4arch.xml +include/sel4/sel4_arch/invocation.h: $(LIBSEL4_DIR)/sel4_arch_include/ia32/interfaces/sel4arch.xml $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/invocation_header_gen.py \ --xml $< --libsel4 --sel4_arch --dest $@ -$(BUILD_BASE_DIR)/include/sel4/arch/invocation.h: $(LIBSEL4_DIR)/arch_include/x86/interfaces/sel4arch.xml +include/sel4/arch/invocation.h: $(LIBSEL4_DIR)/arch_include/x86/interfaces/sel4arch.xml $(MSG_CONVERT)arch/$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/invocation_header_gen.py \ @@ -105,8 +105,7 @@ SEL4_CLIENT_H_SRC := $(LIBSEL4_DIR)/sel4_arch_include/ia32/interfaces/sel4arch.x $(LIBSEL4_DIR)/arch_include/x86/interfaces/sel4arch.xml \ $(LIBSEL4_DIR)/include/interfaces/sel4.xml - -$(BUILD_BASE_DIR)/include/interfaces/sel4_client.h: $(SEL4_CLIENT_H_SRC) +include/interfaces/sel4_client.h: $(SEL4_CLIENT_H_SRC) $(MSG_CONVERT)$(notdir $@) $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE)python $(LIBSEL4_DIR)/tools/syscall_stub_gen.py \ diff --git a/repos/base-sel4/lib/mk/syscall.mk b/repos/base-sel4/lib/mk/syscall.mk deleted file mode 100644 index f5c670dc13..0000000000 --- a/repos/base-sel4/lib/mk/syscall.mk +++ /dev/null @@ -1,5 +0,0 @@ -# -# Syscall library for accessing the seL4 kernel interface. This library is -# merely there to incorporate the corresponding 'import/syscall.mk' file -# in targets that need to issue seL4 system calls. -# diff --git a/repos/base-sel4/mk/spec/sel4.mk b/repos/base-sel4/mk/spec/sel4.mk deleted file mode 100644 index 0537e6b79e..0000000000 --- a/repos/base-sel4/mk/spec/sel4.mk +++ /dev/null @@ -1,7 +0,0 @@ -# -# Clean rule for removing the side effects of building the platform library -# -clean_includes: - $(VERBOSE)rm -rf $(BUILD_BASE_DIR)/include - -clean cleanall: clean_includes diff --git a/repos/base-sel4/mk/spec/sel4_x86_32.mk b/repos/base-sel4/mk/spec/sel4_x86_32.mk index c28cda6d43..17b2b520b5 100644 --- a/repos/base-sel4/mk/spec/sel4_x86_32.mk +++ b/repos/base-sel4/mk/spec/sel4_x86_32.mk @@ -1,8 +1,4 @@ -# -# Specifics for the seL4 kernel API x86 32 bit -# - -SPECS += sel4 x86_32 ps2 vesa framebuffer pci +# \deprecated +SPECS += x86_32 include $(call select_from_repositories,mk/spec/x86_32.mk) -include $(call select_from_repositories,mk/spec/sel4.mk) diff --git a/repos/base-sel4/src/core/sel4/target.mk b/repos/base-sel4/src/core/sel4/target.mk new file mode 100644 index 0000000000..69c83d8c31 --- /dev/null +++ b/repos/base-sel4/src/core/sel4/target.mk @@ -0,0 +1,3 @@ +LIBS = core-sel4 + +include $(BASE_DIR)/src/core/target.inc diff --git a/repos/base-sel4/src/kernel/sel4/target.mk b/repos/base-sel4/src/kernel/sel4/target.mk new file mode 100644 index 0000000000..1f898c0837 --- /dev/null +++ b/repos/base-sel4/src/kernel/sel4/target.mk @@ -0,0 +1,5 @@ +TARGET = sel4 +LIBS = kernel-sel4 + +$(INSTALL_DIR)/$(TARGET): + $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/kernel-sel4/kernel.elf $@ diff --git a/repos/base-sel4/src/kernel/target.mk b/repos/base-sel4/src/kernel/target.mk deleted file mode 100644 index 9954b678be..0000000000 --- a/repos/base-sel4/src/kernel/target.mk +++ /dev/null @@ -1,5 +0,0 @@ -TARGET = sel4 -LIBS = kernel - -$(INSTALL_DIR)/$(TARGET): - $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/kernel/kernel.elf $@ diff --git a/repos/base/lib/mk/spec/arm/startup.mk b/repos/base/lib/mk/spec/arm/startup.inc similarity index 100% rename from repos/base/lib/mk/spec/arm/startup.mk rename to repos/base/lib/mk/spec/arm/startup.inc diff --git a/repos/base/lib/mk/spec/x86_32/startup.mk b/repos/base/lib/mk/spec/x86_32/startup.inc similarity index 100% rename from repos/base/lib/mk/spec/x86_32/startup.mk rename to repos/base/lib/mk/spec/x86_32/startup.inc diff --git a/repos/base/lib/mk/spec/x86_64/startup.mk b/repos/base/lib/mk/spec/x86_64/startup.inc similarity index 100% rename from repos/base/lib/mk/spec/x86_64/startup.mk rename to repos/base/lib/mk/spec/x86_64/startup.inc diff --git a/repos/base/src/core/target.mk b/repos/base/src/core/target.inc similarity index 93% rename from repos/base/src/core/target.mk rename to repos/base/src/core/target.inc index 1cabfdcb4c..bac8d28fa8 100644 --- a/repos/base/src/core/target.mk +++ b/repos/base/src/core/target.inc @@ -1,5 +1,4 @@ TARGET = core -LIBS = core CORE_OBJ = core.o $(TARGET): $(CORE_OBJ) diff --git a/repos/dde_rump/src/server/rump_cgd/target.mk b/repos/dde_rump/src/server/rump_cgd/target.mk index 10cd53fd65..32d5cb7653 100644 --- a/repos/dde_rump/src/server/rump_cgd/target.mk +++ b/repos/dde_rump/src/server/rump_cgd/target.mk @@ -1,4 +1,4 @@ TARGET = rump_cgd SRC_CC = cgd.cc main.cc random.cc -LIBS = rump rump_cgd startup jitterentropy +LIBS = rump rump_cgd jitterentropy diff --git a/repos/dde_rump/src/server/rump_fs/target.mk b/repos/dde_rump/src/server/rump_fs/target.mk index aea32b44cb..e391ac4ab7 100644 --- a/repos/dde_rump/src/server/rump_fs/target.mk +++ b/repos/dde_rump/src/server/rump_fs/target.mk @@ -1,5 +1,5 @@ TARGET = rump_fs SRC_CC = main.cc file_system.cc random.cc -LIBS = rump rump_fs startup +LIBS = rump rump_fs diff --git a/repos/os/lib/mk/foc_cli_monitor.mk b/repos/os/lib/mk/foc_cli_monitor.mk index 686ac7cbdd..01e58a8d3b 100644 --- a/repos/os/lib/mk/foc_cli_monitor.mk +++ b/repos/os/lib/mk/foc_cli_monitor.mk @@ -2,5 +2,6 @@ SRC_CC = extension.cc REQUIRES = foc INC_DIR += $(REP_DIR)/src/app/cli_monitor \ $(REP_DIR)/src/app/cli_monitor/spec/foc +LIBS += syscall-foc vpath extension.cc $(REP_DIR)/src/app/cli_monitor/spec/foc diff --git a/repos/os/lib/mk/spec/arndale/foc_cli_monitor.mk b/repos/os/lib/mk/spec/arndale/foc_cli_monitor.mk index c9087390c9..9f7fed970b 100644 --- a/repos/os/lib/mk/spec/arndale/foc_cli_monitor.mk +++ b/repos/os/lib/mk/spec/arndale/foc_cli_monitor.mk @@ -2,5 +2,6 @@ SRC_CC = extension.cc REQUIRES = foc_arndale INC_DIR += $(REP_DIR)/src/app/cli_monitor \ $(REP_DIR)/src/app/cli_monitor/spec/foc +LIBS += syscall-foc vpath extension.cc $(REP_DIR)/src/app/cli_monitor/spec/foc/arndale diff --git a/repos/os/src/drivers/timer/fiasco/target.mk b/repos/os/src/drivers/timer/fiasco/target.mk index fc93431c1e..95d23b6244 100644 --- a/repos/os/src/drivers/timer/fiasco/target.mk +++ b/repos/os/src/drivers/timer/fiasco/target.mk @@ -1,5 +1,6 @@ TARGET = fiasco_timer_drv REQUIRES = fiasco +LIBS += syscall-fiasco INC_DIR += $(REP_DIR)/src/drivers/timer/periodic SRC_CC += periodic/time_source.cc fiasco/time_source.cc diff --git a/repos/os/src/drivers/timer/foc/target.mk b/repos/os/src/drivers/timer/foc/target.mk index 5de0b4b5dd..38b2cc8d56 100644 --- a/repos/os/src/drivers/timer/foc/target.mk +++ b/repos/os/src/drivers/timer/foc/target.mk @@ -1,5 +1,6 @@ TARGET = foc_timer_drv REQUIRES = foc +LIBS += syscall-foc INC_DIR += $(REP_DIR)/src/drivers/timer/periodic SRC_CC += periodic/time_source.cc fiasco/time_source.cc diff --git a/repos/os/src/drivers/timer/linux/target.mk b/repos/os/src/drivers/timer/linux/target.mk index 9aeefc5112..6ab25b38c2 100644 --- a/repos/os/src/drivers/timer/linux/target.mk +++ b/repos/os/src/drivers/timer/linux/target.mk @@ -2,6 +2,6 @@ TARGET = linux_timer_drv REQUIRES = linux INC_DIR += $(REP_DIR)/src/drivers/timer/periodic SRC_CC += periodic/time_source.cc linux/time_source.cc -LIBS += syscall +LIBS += syscall-linux include $(REP_DIR)/src/drivers/timer/target.inc diff --git a/repos/os/src/drivers/timer/pistachio/target.mk b/repos/os/src/drivers/timer/pistachio/target.mk index dc3d7cf8dd..74f58aec2e 100644 --- a/repos/os/src/drivers/timer/pistachio/target.mk +++ b/repos/os/src/drivers/timer/pistachio/target.mk @@ -3,6 +3,6 @@ REQUIRES = pistachio INC_DIR += $(REP_DIR)/src/drivers/timer/include INC_DIR += $(REP_DIR)/src/drivers/timer/periodic SRC_CC += periodic/time_source.cc pistachio/time_source.cc main.cc -LIBS += syscall base-pistachio timeout +LIBS += syscall-pistachio base-pistachio timeout vpath %.cc $(REP_DIR)/src/drivers/timer diff --git a/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk b/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk index 6a4aedbd6d..4ae77d97fb 100644 --- a/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk +++ b/repos/os/src/drivers/uart/kdb/spec/fiasco/target.mk @@ -1,3 +1,5 @@ REQUIRES = fiasco +LIBS += syscall-fiasco + include $(REP_DIR)/src/drivers/uart/kdb/target.inc diff --git a/repos/os/src/drivers/uart/kdb/spec/foc/target.mk b/repos/os/src/drivers/uart/kdb/spec/foc/target.mk index 745711d231..0212a7470b 100644 --- a/repos/os/src/drivers/uart/kdb/spec/foc/target.mk +++ b/repos/os/src/drivers/uart/kdb/spec/foc/target.mk @@ -1,3 +1,5 @@ REQUIRES = foc +LIBS += syscall-foc + include $(REP_DIR)/src/drivers/uart/kdb/target.inc diff --git a/repos/os/src/drivers/uart/kdb/target.inc b/repos/os/src/drivers/uart/kdb/target.inc index 0dd3fc1afe..a03f704234 100644 --- a/repos/os/src/drivers/uart/kdb/target.inc +++ b/repos/os/src/drivers/uart/kdb/target.inc @@ -1,6 +1,6 @@ TARGET = kdb_uart_drv SRC_CC = main.cc -LIBS = base config +LIBS += base config INC_DIR += $(REP_DIR)/src/drivers/uart $(REP_DIR)/src/drivers/uart/kdb vpath main.cc $(REP_DIR)/src/drivers/uart diff --git a/repos/os/src/test/timer_accuracy/target.mk b/repos/os/src/test/timer_accuracy/target.mk index fbaf2bec36..432ef55bec 100644 --- a/repos/os/src/test/timer_accuracy/target.mk +++ b/repos/os/src/test/timer_accuracy/target.mk @@ -1,4 +1,4 @@ TARGET = test-timer_accuracy REQUIRES = linux SRC_CC = main.cc -LIBS = base syscall +LIBS = base syscall-linux diff --git a/repos/ports-foc/lib/mk/l4lx.mk b/repos/ports-foc/lib/mk/l4lx.mk index 7bb422c4a8..588f4fe51f 100644 --- a/repos/ports-foc/lib/mk/l4lx.mk +++ b/repos/ports-foc/lib/mk/l4lx.mk @@ -36,6 +36,6 @@ INC_DIR += $(REP_DIR)/include \ # for reusing the 'Expanding_rm_session' from the platform env in dataspace.h INC_DIR += $(BASE_DIR)/src/include -LIBS = base config +LIBS = base-foc config syscall-foc vpath %.cc $(REP_DIR)/src/lib/l4lx diff --git a/repos/ports-foc/lib/mk/l4sys.mk b/repos/ports-foc/lib/mk/l4sys.mk index d2581272db..b78cba9f23 100644 --- a/repos/ports-foc/lib/mk/l4sys.mk +++ b/repos/ports-foc/lib/mk/l4sys.mk @@ -1,3 +1,5 @@ SRC_C += errtostr.c -vpath errtostr.c $(L4_BUILD_DIR)/source/pkg/l4sys/lib/src +LIBS += syscall-foc + +vpath errtostr.c $(LIB_CACHE_DIR)/syscall-foc/build/source/pkg/l4sys/lib/src diff --git a/repos/ports-foc/mk/l4lx.mk b/repos/ports-foc/mk/l4lx.mk index 5c98aee093..eeeeef7955 100644 --- a/repos/ports-foc/mk/l4lx.mk +++ b/repos/ports-foc/mk/l4lx.mk @@ -2,8 +2,8 @@ TARGET = vmlinux VERBOSE_LX_MK ?= 0 REQUIRES += foc INC_DIR += $(REP_DIR)/include -LIBS = l4lx l4sys -GENODE_LIBS := base-foc base-foc-common startup syscall cxx l4lx l4sys config +LIBS = l4lx l4sys syscall-foc +GENODE_LIBS := base-foc base-foc-common startup-foc syscall-foc cxx l4lx l4sys config GENODE_LIBS := $(foreach l,$(GENODE_LIBS),$(BUILD_BASE_DIR)/var/libcache/$l/$l.lib.a) GENODE_LIBS_SORTED = $(sort $(wildcard $(GENODE_LIBS))) @@ -15,6 +15,10 @@ L4LX_BINARY = $(L4LX_BUILD)/$(TARGET) L4LX_SYMLINK = $(BUILD_BASE_DIR)/bin/$(LX_TARGET) L4LX_CONFIG = $(L4LX_BUILD)/.config +L4_BUILD_DIR := $(LIB_CACHE_DIR)/syscall-foc/build + +BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [l4linux] /" + $(TARGET): $(L4LX_BINARY) $(L4LX_BINARY): $(L4LX_CONFIG) @@ -27,7 +31,7 @@ $(L4LX_BINARY): $(L4LX_CONFIG) V=$(VERBOSE_LX_MK) \ GENODE_INCLUDES="$(addprefix -I,$(INC_DIR))" \ GENODE_LIBS="$(GENODE_LIBS_SORTED)" \ - L4ARCH="$(L4LX_L4ARCH)" || false + L4ARCH="$(L4LX_L4ARCH)" $(BUILD_OUTPUT_FILTER) || false $(VERBOSE)ln -sf $@ $(L4LX_SYMLINK) $(L4LX_CONFIG): $(SRC_L4LX_CONFIG) diff --git a/repos/ports-foc/src/l4linux/x86_32/target.mk b/repos/ports-foc/src/l4linux/x86_32/target.mk index 018ec7dba2..1896d09851 100644 --- a/repos/ports-foc/src/l4linux/x86_32/target.mk +++ b/repos/ports-foc/src/l4linux/x86_32/target.mk @@ -3,4 +3,4 @@ INC_DIR += $(REP_DIR)/include/32-bit LX_TARGET = l4linux SRC_L4LX_CONFIG = $(REP_DIR)/config/linux_config.x86_32 --include $(REP_DIR)/mk/l4lx.mk +include $(REP_DIR)/mk/l4lx.mk diff --git a/repos/ports/lib/mk/spec/foc_arm/gdbserver_platform.mk b/repos/ports/lib/mk/spec/foc_arm/gdbserver_platform.mk index 5ed1b416f2..9d12cdff7d 100644 --- a/repos/ports/lib/mk/spec/foc_arm/gdbserver_platform.mk +++ b/repos/ports/lib/mk/spec/foc_arm/gdbserver_platform.mk @@ -6,4 +6,6 @@ SRC_C = reg-arm.c \ CC_OPT_linux-arm-low += -Wno-unused-function +LIBS += syscall-foc + include $(REP_DIR)/lib/mk/gdbserver_platform.inc diff --git a/repos/ports/lib/mk/spec/foc_x86_32/gdbserver_platform.mk b/repos/ports/lib/mk/spec/foc_x86_32/gdbserver_platform.mk index 7d91ae7430..6d0ff8d17c 100644 --- a/repos/ports/lib/mk/spec/foc_x86_32/gdbserver_platform.mk +++ b/repos/ports/lib/mk/spec/foc_x86_32/gdbserver_platform.mk @@ -1,4 +1,6 @@ SRC_CC = spec/foc_x86_32/low.cc \ spec/foc/native_cpu.cc +LIBS += syscall-foc + include $(REP_DIR)/lib/mk/spec/x86_32/gdbserver_platform.inc diff --git a/tool/builddir/build.mk b/tool/builddir/build.mk index 5bbb93564c..a3f3854f82 100644 --- a/tool/builddir/build.mk +++ b/tool/builddir/build.mk @@ -71,11 +71,25 @@ BASE_DIR := $(realpath $(shell echo $(BASE_DIR))) # export SHELL := $(shell which bash) -select_from_repositories = $(firstword $(foreach REP,$(REPOSITORIES),$(wildcard $(REP)/$(1)))) - --include $(call select_from_repositories,etc/specs.conf) +# +# Fetch SPECS configuration from all source repositories and the build directory +# +SPECS := +-include $(foreach REP,$(REPOSITORIES),$(wildcard $(REP)/etc/specs.conf)) -include $(BUILD_BASE_DIR)/etc/specs.conf +# +# \deprecated We include the repository-specific 'specs.conf' once again as the +# build-dir-local etc/specs.conf (as created by create_builddir) +# reassigns the 'SPECS' variable instead of appending it. +# We sort the 'SPECS' to remove duplicates. We should remove this +# once the old 'create_builddir' arguments are gone. +# +-include $(foreach REP,$(REPOSITORIES),$(wildcard $(REP)/etc/specs.conf)) +SPECS := $(sort $(SPECS)) + +select_from_repositories = $(firstword $(foreach REP,$(REPOSITORIES),$(wildcard $(REP)/$(1)))) + # # Determine the spec files to incorporate into the build configuration from the # repositories. Always consider the spec files present in BASE_DIR. This is diff --git a/tool/run/boot_dir/fiasco b/tool/run/boot_dir/fiasco index 4e68df41cf..5bd2525fa7 100644 --- a/tool/run/boot_dir/fiasco +++ b/tool/run/boot_dir/fiasco @@ -1,55 +1,11 @@ proc binary_name_ld_lib_so { } { return "ld-fiasco.lib.so" } +proc binary_name_core_o { } { return "fiasco/core.o" } proc binary_name_timer { } { return "fiasco_timer_drv" } -## -# Read the location of the Fiasco user directory from 'etc/fiasco.conf' -# -proc l4_dir { } { - global _l4_dir - - if {![info exists _l4_dir]} { - if {[file exists etc/fiasco.conf]} { - set _l4_dir [exec sed -n "/^L4_BUILD_DIR/s/^.*=\\s*//p" etc/fiasco.conf] - if {[file exists $_l4_dir]} { return $_l4_dir } - } - - set _l4_dir "[pwd]/l4" - if {![file exists $_l4_dir]} { - puts -nonewline stderr "Error: Could neither find the L4 build directory " - puts -nonewline stderr "within '/l4' nor at a location " - puts -nonewline stderr "specified via 'L4_BUILD_DIR = ' " - puts stderr "in /etc/fiasco.conf'." - exit 1 - } - } - return $_l4_dir -} - - -## -# Return the location of the Fiasco kernel -# -proc fiasco { } { - return [kernel_location_from_config_file etc/fiasco.conf [pwd]/kernel/fiasco/fiasco] -} - - -proc bin_dir { } { - if {[have_spec x86_32]} { return "[l4_dir]/bin/x86_586" } - - puts stderr "Error: Cannot determine bin directory" - exit 1 -} - -set fiasco_serial_esc_arg "-serial_esc " - - -proc run_boot_string { } { - return "\nL4 Bootstrapper" -} - -proc core_link_address { } { return "0x01000000" } +proc fiasco_serial_esc_arg { } { return "-serial_esc " } +proc run_boot_string { } { return "\nL4 Bootstrapper" } +proc core_link_address { } { return "0x01000000" } ## @@ -57,24 +13,17 @@ proc core_link_address { } { return "0x01000000" } # proc run_boot_dir {binaries} { - build { lib/ld/fiasco kernel bootstrap sigma0 } + build { lib/ld/fiasco kernel/fiasco } build_core_image $binaries - global fiasco_serial_esc_arg - exec mkdir -p [run_dir]/fiasco - - # assert existence of the L4 build directory - l4_dir - - puts "using fiasco kernel [fiasco]" - exec cp [fiasco] [run_dir]/fiasco/fiasco - puts "using sigma0/bootstrap at [l4_dir]" - exec cp [bin_dir]/l4v2/sigma0 [run_dir]/fiasco - exec cp [bin_dir]/bootstrap [run_dir]/fiasco + exec cp kernel/fiasco/kernel [run_dir]/fiasco + exec cp kernel/fiasco/sigma0 [run_dir]/fiasco + exec cp kernel/fiasco/bootstrap [run_dir]/fiasco if {[have_include "image/iso"] || [have_include "image/disk"]} { + # # Install isolinux/GRUB files and bender # @@ -92,7 +41,7 @@ proc run_boot_dir {binaries} { puts $fh "\ntitle Genode on L4/Fiasco" puts $fh " kernel /boot/bender" puts $fh " module /fiasco/bootstrap -serial" - puts $fh " module /fiasco/fiasco -serial -jdb_cmd=JH $fiasco_serial_esc_arg" + puts $fh " module /fiasco/kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]" puts $fh " module /fiasco/sigma0" puts $fh " module /image.elf" puts $fh " vbeset 0x117 506070" @@ -113,7 +62,7 @@ proc run_boot_dir {binaries} { set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"] puts $fh " exec /boot/bender" puts $fh " load /fiasco/bootstrap -serial" - puts $fh " load /fiasco/fiasco -serial -serial_esc -jdb_cmd=JH" + puts $fh " load /fiasco/kernel -serial -serial_esc -jdb_cmd=JH" puts $fh " load /fiasco/sigma0" puts $fh " load /image.elf" close $fh diff --git a/tool/run/boot_dir/foc b/tool/run/boot_dir/foc index 4b8450d18e..bb793c801e 100644 --- a/tool/run/boot_dir/foc +++ b/tool/run/boot_dir/foc @@ -1,64 +1,28 @@ proc binary_name_ld_lib_so { } { return "ld-foc.lib.so" } +proc binary_name_core_o { } { return "foc/core.o" } proc binary_name_timer { } { return "foc_timer_drv" } -## -# Return the location of the Fiasco.OC user directory -# -proc l4_dir { } { - global _l4_dir +proc run_boot_string { } { return "\nL4 Bootstrapper" } - if {![info exists _l4_dir]} { - if {[file exists etc/foc.conf]} { - set _l4_dir [exec sed -n "/^L4_BUILD_DIR/s/^.*=\\s*//p" etc/foc.conf] - if {[file exists $_l4_dir]} { return $_l4_dir } - } - set _l4_dir "[pwd]/l4" - if {![file exists $_l4_dir]} { - puts -nonewline stderr "Error: Could neither find the L4 build directory " - puts -nonewline stderr "within '/l4' nor at a location " - puts -nonewline stderr "specified via 'L4_BUILD_DIR = ' " - puts stderr "in /etc/foc.conf'." - exit 1 - } - } - return $_l4_dir +proc core_link_address { } { + + if {[have_spec x86 ]} { return "0x01100000" } + if {[have_spec arndale ]} { return "0x80100000" } + if {[have_spec rpi ]} { return "0x00800000" } + if {[have_spec panda ]} { return "0xa0000000" } + if {[have_spec pbxa9 ]} { return "0x76000000" } + if {[have_spec odroid_x2]} { return "0x80100000" } + if {[have_spec imx53 ]} { return "0x70140000" } + + puts stderr "Error: platform not supported, core link address unknown" + exit 1 } -## -# Return whether the l4-buid-directory is provided from the outside -# -proc l4_dir_external { } { - if {[l4_dir] == "[pwd]/l4"} { return 0 } - return 1 -} -## -# Return the location of the Fiasco.OC kernel directory -# -proc fiasco { } { - global _fiasco +proc fiasco_serial_esc_arg { } { return "-serial_esc " } - if {![info exists _fiasco]} { - if {[file exists etc/foc.conf]} { - set _fiasco [exec sed -n "/^KERNEL/s/^.*=\\s*//p" etc/foc.conf] - if {[file exists $_fiasco]} { return $_fiasco } - } - - # try to fall back to version hosted with the Genode build directory - set _fiasco "[pwd]/kernel/fiasco.oc/fiasco" - } - return $_fiasco -} - -## -# Return whether fiasco kernel is provided from the outside -# -proc fiasco_external { } { - if {[fiasco] == "[pwd]/kernel/fiasco.oc/fiasco"} { return 0 } - return 1 -} ## # Reset the target system via the Fiasco.OC kernel debugger @@ -72,57 +36,37 @@ proc reset_target { {spawn_id_arg -1} } { } -proc bin_dir { } { - if {[have_spec x86_32]} { return "[l4_dir]/bin/x86_586" } - if {[have_spec x86_64]} { return "[l4_dir]/bin/amd64_K8" } - if {[have_spec arm_v7a]} { return "[l4_dir]/bin/arm_armv7a" } - if {[have_spec arm_v6]} { return "[l4_dir]/bin/arm_armv6" } +proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc/build" } + + +proc kernel_binary { } { return "[pwd]/var/libcache/kernel-foc/build/fiasco" } + + +proc l4_bin_dir { } { + + if {[have_spec x86_32]} { return "[l4_build_dir]/bin/x86_586" } + if {[have_spec x86_64]} { return "[l4_build_dir]/bin/amd64_K8" } + if {[have_spec arm_v7a]} { return "[l4_build_dir]/bin/arm_armv7a" } + if {[have_spec arm_v6]} { return "[l4_build_dir]/bin/arm_armv6" } puts stderr "Error: Cannot determine bin directory" exit 1 } -set fiasco_serial_esc_arg "-serial_esc " - -proc core_link_address { } { - if {[have_spec x86 ]} { return "0x01100000" } - if {[have_spec arndale ]} { return "0x80100000" } - if {[have_spec rpi ]} { return "0x00800000" } - if {[have_spec panda ]} { return "0xa0000000" } - if {[have_spec pbxa9 ]} { return "0x76000000" } - if {[have_spec odroid_x2]} { return "0x80100000" } - if {[have_spec imx53 ]} { return "0x70140000" } - - puts stderr "Error: platform not supported, core link address unknown" - exit 1 -} proc run_boot_dir_x86 {binaries} { - global fiasco_serial_esc_arg - - exec mkdir -p [run_dir]/fiasco - - set foc_targets { lib/ld/foc } - if {![fiasco_external] && ![file exists kernel]} { lappend foc_targets kernel } - if {![l4_dir_external]} { - if {![file exists bootstrap]} { lappend foc_targets bootstrap } - if {![file exists sigma0]} { lappend foc_targets sigma0 } - } - if {[llength $foc_targets] > 0} { build $foc_targets } + build { lib/ld/foc kernel/foc } build_core_image $binaries - # assert existence of the L4 build directory - l4_dir - - puts "using fiasco kernel [fiasco]" - exec cp [fiasco] [run_dir]/fiasco - puts "using sigma0/bootstrap at [l4_dir]" - exec cp [bin_dir]/l4f/sigma0 [run_dir]/fiasco - exec cp [bin_dir]/bootstrap [run_dir]/fiasco + exec mkdir [run_dir]/foc + exec cp [kernel_binary] [run_dir]/foc/kernel + exec cp [l4_bin_dir]/l4f/sigma0 [run_dir]/foc + exec cp [l4_bin_dir]/bootstrap [run_dir]/foc if {[have_include "image/iso"] || [have_include "image/disk"]} { + # # Install isolinux/GRUB files and bender # @@ -139,9 +83,9 @@ proc run_boot_dir_x86 {binaries} { puts $fh "default 0" puts $fh "\ntitle Genode on Fiasco.OC" puts $fh " kernel /boot/bender" - puts $fh " module /fiasco/bootstrap" - puts $fh " module /fiasco/fiasco $fiasco_serial_esc_arg" - puts $fh " module /fiasco/sigma0" + puts $fh " module /foc/bootstrap" + puts $fh " module /foc/kernel [fiasco_serial_esc_arg]" + puts $fh " module /foc/sigma0" puts $fh " module /image.elf" close $fh } @@ -162,9 +106,9 @@ proc run_boot_dir_x86 {binaries} { # set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"] puts $fh " exec /boot/bender" - puts $fh " load /fiasco/bootstrap" - puts $fh " load /fiasco/fiasco -serial_esc" - puts $fh " load /fiasco/sigma0" + puts $fh " load /foc/bootstrap" + puts $fh " load /foc/kernel -serial_esc" + puts $fh " load /foc/sigma0" puts $fh " load /image.elf" close $fh @@ -179,12 +123,11 @@ proc run_boot_dir_x86 {binaries} { } -proc run_boot_dir_arm {binaries} { +proc run_boot_dir_arm { binaries } { global run_target - global fiasco_serial_esc_arg - build { lib/ld/foc kernel sigma0 bootstrap } + build { lib/ld/foc kernel/foc } build_core_image $binaries @@ -195,25 +138,24 @@ proc run_boot_dir_arm {binaries} { puts $fh "modaddr 0x01100000\n" puts $fh "entry genode" - puts $fh "kernel [fiasco] $fiasco_serial_esc_arg" + puts $fh "kernel [kernel_binary] [fiasco_serial_esc_arg]" puts $fh "roottask image.elf" close $fh - - set gen_img_cmd "make -C [l4_dir]/source O=[l4_dir] E=genode " + set gen_img_cmd "make -C [l4_build_dir]/source O=[l4_build_dir] E=genode " append gen_img_cmd "MODULES_LIST=[pwd]/[run_dir]/modules.list " - append gen_img_cmd "MODULE_SEARCH_PATH=[pwd]/[run_dir]:[file dirname [fiasco]]:[l4_dir] " + append gen_img_cmd "MODULE_SEARCH_PATH=[pwd]/[run_dir]:[pwd]:[l4_build_dir] " append gen_img_cmd "SYSTEM_TARGET=[cross_dev_prefix] elfimage" set pid [eval "spawn sh -c \"$gen_img_cmd\""] expect { eof { } } if {[lindex [wait $pid] end] != 0} { - puts stderr "Error: Single-image creation failed" + puts stderr "Error: single-image creation failed" exit -4 } exec cp [run_dir]/image.elf [run_dir]/core.elf - exec cp [bin_dir]/bootstrap.elf [run_dir]/image.elf + exec cp [l4_bin_dir]/bootstrap.elf [run_dir]/image.elf run_image [run_dir]/image.elf puts "\nboot image: [run_dir]/image.elf\n" @@ -231,11 +173,6 @@ proc run_boot_dir_arm {binaries} { } -proc run_boot_string { } { - return "\nL4 Bootstrapper" -} - - ## # Populate boot directory with binaries on fiasco.OC # diff --git a/tool/run/boot_dir/hw b/tool/run/boot_dir/hw index e686e0267d..076bcef89c 100644 --- a/tool/run/boot_dir/hw +++ b/tool/run/boot_dir/hw @@ -1,4 +1,5 @@ proc binary_name_ld_lib_so { } { return "ld-hw.lib.so" } +proc binary_name_core_o { } { return "hw/core.o" } proc binary_name_timer { } { return "hw_timer_drv" } diff --git a/tool/run/boot_dir/linux b/tool/run/boot_dir/linux index 11088bf1d0..149271354c 100644 --- a/tool/run/boot_dir/linux +++ b/tool/run/boot_dir/linux @@ -1,4 +1,5 @@ proc binary_name_ld_lib_so { } { return "ld-linux.lib.so" } +proc binary_name_core { } { return "core-linux" } proc binary_name_timer { } { return "linux_timer_drv" } diff --git a/tool/run/boot_dir/nova b/tool/run/boot_dir/nova index 9aad25886a..bd62da9366 100644 --- a/tool/run/boot_dir/nova +++ b/tool/run/boot_dir/nova @@ -1,4 +1,5 @@ proc binary_name_ld_lib_so { } { return "ld-nova.lib.so" } +proc binary_name_core_o { } { return "nova/core.o" } proc binary_name_timer { } { return "nova_timer_drv" } @@ -12,7 +13,7 @@ proc nova_kernel { } { if {[file exists etc/nova.conf]} { set _nova_kernel [exec sed -n "/^NOVA_KERNEL/s/^.*=\\s*//p" etc/nova.conf] } else { - set _nova_kernel "[pwd]/kernel/hypervisor" + set _nova_kernel "[pwd]/kernel/nova/hypervisor" } } return $_nova_kernel @@ -23,7 +24,7 @@ proc nova_kernel { } { # Return whether nova is provided from the outside # proc nova_external { } { - if {[nova_kernel] == "[pwd]/kernel/hypervisor"} { return 0 } + if {[nova_kernel] == "[pwd]/kernel/nova/hypervisor"} { return 0 } return 1 } diff --git a/tool/run/boot_dir/okl4 b/tool/run/boot_dir/okl4 index ff91e7f61e..efc20cb1d0 100644 --- a/tool/run/boot_dir/okl4 +++ b/tool/run/boot_dir/okl4 @@ -1,4 +1,5 @@ proc binary_name_ld_lib_so { } { return "ld-okl4.lib.so" } +proc binary_name_core_o { } { return "okl4/core.o" } proc binary_name_timer { } { return "pit_timer_drv" } @@ -27,15 +28,6 @@ proc okl4_dir { } { } -## -# Return the location of the OKL4 kernel -# -proc okl4 { } { - if {[okl4_external]} { return [okl4_dir]/build/pistachio/bin/kernel } - return bin/kernel -} - - ## # Return whether okl4 kernel is provided from the outside # @@ -129,8 +121,8 @@ proc run_boot_dir {binaries} { # the kernel does not stand in the way of the everyday's work flow of # executing run scripts as quick as possible. # - if {![okl4_external] && ![file exists [okl4]]} { - build { lib/ld/okl4 kernel } + if {![okl4_external] && ![file exists bin/okl4]} { + build { lib/ld/okl4 kernel/okl4 } } else { build { lib/ld/okl4 } } @@ -138,7 +130,7 @@ proc run_boot_dir {binaries} { build_core_image $binaries exec mv [run_dir]/image.elf [run_dir].image - exec cp [okl4] [run_dir]/kernel + exec cp bin/okl4 [run_dir]/kernel # # Generate ELF weaver config diff --git a/tool/run/boot_dir/pistachio b/tool/run/boot_dir/pistachio index 1985200907..0e396e20f3 100644 --- a/tool/run/boot_dir/pistachio +++ b/tool/run/boot_dir/pistachio @@ -1,7 +1,12 @@ proc binary_name_ld_lib_so { } { return "ld-pistachio.lib.so" } +proc binary_name_core_o { } { return "pistachio/core.o" } proc binary_name_timer { } { return "pistachio_timer_drv" } +proc run_boot_string { } { return "\n\r\033\\\[1m\033\\\[33mL4Ka::Pistachio -" } +proc core_link_address { } { return "0x02000000" } + + ## # Install files needed to boot via PXE # @@ -11,79 +16,23 @@ proc install_pxe_bootloader_to_run_dir { } { } -## -# Read the location of the Pistachio user directory from 'etc/pistachio.conf' -# -proc pistachio_user_dir { } { - global _pistachio_user_dir - - if {![info exists _pistachio_user_dir]} { - if {[file exists etc/pistachio.conf]} { - set _pistachio_user_dir [exec sed -n "/^PISTACHIO_USER_BUILD_DIR/s/^.*=\\s*//p" etc/pistachio.conf] - } else { - set _pistachio_user_dir "[pwd]/l4" - } - } - return $_pistachio_user_dir -} - - -## -# Read the location of the Pistachio kernel directory from 'etc/pistachio.conf' -# or return a good heuristic -# -proc pistachio_kernel { } { - global _pistachio_kernel - - if {![info exists _pistachio_kernel]} { - if {[file exists etc/pistachio.conf]} { - set _pistachio_kernel [exec sed -n "/^PISTACHIO_KERNEL/s/^.*=\\s*//p" etc/pistachio.conf] - if {$_pistachio_kernel == ""} { - set _pistachio_kernel [file dirname [file dirname [pistachio_user_dir]]]/kernel/build/x86-kernel - } - } else { - set _pistachio_kernel "[pwd]/bin/kernel" - } - } - return $_pistachio_kernel -} - - -## -# Return whether the kernel is provided from the outside -# -proc kernel_external { } { - if {[pistachio_kernel] == "[pwd]/bin/kernel"} { return 0 } - return 1 -} - - -proc run_boot_string { } { - return "\n\r\033\\\[1m\033\\\[33mL4Ka::Pistachio -" -} - -proc core_link_address { } { return "0x02000000" } - ## # Populdate boot directory with binaries on pistachio # proc run_boot_dir {binaries} { - if {![kernel_external] && ![file exists [pistachio_kernel]]} { - build { lib/ld/pistachio kernel } - } else { - build { lib/ld/pistachio } - } + build { lib/ld/pistachio kernel/pistachio } build_core_image $binaries exec mkdir -p [run_dir]/pistachio - exec cp [pistachio_kernel] [run_dir]/pistachio/kernel - exec cp [pistachio_user_dir]/serv/sigma0/sigma0 [run_dir]/pistachio - exec cp [pistachio_user_dir]/util/kickstart/kickstart [run_dir]/pistachio + exec cp kernel/pistachio/kernel [run_dir]/pistachio + exec cp kernel/pistachio/sigma0 [run_dir]/pistachio + exec cp kernel/pistachio/kickstart [run_dir]/pistachio if {[have_include "image/iso"] || [have_include "image/disk"]} { + # # Install isolinux/GRUB files and bender # diff --git a/tool/run/boot_dir/sel4 b/tool/run/boot_dir/sel4 index 6e72ee59dc..b16bcc6618 100644 --- a/tool/run/boot_dir/sel4 +++ b/tool/run/boot_dir/sel4 @@ -1,4 +1,5 @@ proc binary_name_ld_lib_so { } { return "ld-sel4.lib.so" } +proc binary_name_core_o { } { return "sel4/core.o" } proc binary_name_timer { } { return "pit_timer_drv" } @@ -12,7 +13,7 @@ proc core_link_address { } { return "0x02000000" } proc run_boot_dir {binaries} { # build sel4 kernel - build { lib/ld/sel4 kernel } + build { lib/ld/sel4 kernel/sel4 } exec cp bin/sel4 [run_dir]/sel4 build_core_image $binaries diff --git a/tool/run/run b/tool/run/run index 95a59c1027..629c2dd730 100755 --- a/tool/run/run +++ b/tool/run/run @@ -775,11 +775,13 @@ proc build_core_image {binaries} { copy_and_strip_genode_binaries_to_run_dir $modules lappend modules "config" + set core_obj core/[kernel_specific_binary core.o] + # create core binary without modules for debugging - build_core core/core.o {} [run_dir].core + build_core $core_obj {} [run_dir].core # create core binary containing the boot modules - build_core core/core.o $modules [run_dir]/image.elf + build_core $core_obj $modules [run_dir]/image.elf exec [cross_dev_prefix]strip [run_dir]/image.elf }