diff --git a/repos/base-fiasco/src/kernel/fiasco/target.mk b/repos/base-fiasco/src/kernel/fiasco/target.mk index 6f2e194c5c..ea3fb1bc73 100644 --- a/repos/base-fiasco/src/kernel/fiasco/target.mk +++ b/repos/base-fiasco/src/kernel/fiasco/target.mk @@ -1,18 +1,18 @@ TARGET = kernel-fiasco LIBS = kernel-fiasco -$(TARGET): sigma0 bootstrap kernel +$(TARGET): $(INSTALL_DIR)/fiasco $(INSTALL_DIR)/sigma0-fiasco $(INSTALL_DIR)/bootstrap-fiasco L4_BUILD_DIR = $(LIB_CACHE_DIR)/syscall-fiasco -kernel: +$(INSTALL_DIR)/fiasco: $(VERBOSE)ln -sf $(LIB_CACHE_DIR)/kernel-fiasco/build/fiasco $@ -sigma0: - $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/l4v2/sigma0 +$(INSTALL_DIR)/sigma0-fiasco: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/l4v2/sigma0 $@ -bootstrap: - $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/bootstrap +$(INSTALL_DIR)/bootstrap-fiasco: + $(VERBOSE)ln -sf $(L4_BUILD_DIR)/bin/x86_586/bootstrap $@ clean cleanall: $(VERBOSE)rm -f kernel sigma0 bootstrap diff --git a/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk b/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk index f496abb1b9..d06e0f479e 100644 --- a/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/arndale/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/arndale.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index 683d2b8f25..4d4fea59b5 100644 --- a/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/imx53/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/imx53.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index feab02a721..37f4e6bf71 100644 --- a/repos/base-foc/lib/mk/spec/odroid_x2/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/odroid_x2/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/odroid_x2.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index ec7ce9de1c..0cd78154ed 100644 --- a/repos/base-foc/lib/mk/spec/panda/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/panda/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/panda.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index 46f11ba874..8eb67d6ecc 100644 --- a/repos/base-foc/lib/mk/spec/pbxa9/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/pbxa9/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/pbxa9.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv7a + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index 8d424ec193..06166f593d 100644 --- a/repos/base-foc/lib/mk/spec/rpi/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/rpi/syscall-foc.mk @@ -1,3 +1,5 @@ L4_CONFIG := $(call select_from_repositories,config/rpi.user) +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/arm_armv6 + include $(REP_DIR)/lib/mk/spec/arm/syscall-foc.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 index b21f254917..464d10c7b4 100644 --- a/repos/base-foc/lib/mk/spec/x86_32/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/x86_32/syscall-foc.mk @@ -4,6 +4,8 @@ L4_INC_TARGETS := x86/l4/sys x86/l4f/l4/sys x86/l4/vcpu CC_OPT += -Iinclude/x86 +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/x86_586 + 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/syscall-foc.mk b/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk index 627dfdc593..b588f3deee 100644 --- a/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk +++ b/repos/base-foc/lib/mk/spec/x86_64/syscall-foc.mk @@ -4,4 +4,6 @@ L4_INC_TARGETS := amd64/l4/sys amd64/l4f/l4/sys amd64/l4/vcpu CC_OPT += -Iinclude/amd64 +L4_BIN_DIR := $(LIB_CACHE_DIR)/syscall-foc/build/bin/amd64_K8 + 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 index 033bc0b74b..52b2095db0 100644 --- a/repos/base-foc/lib/mk/syscall-foc.inc +++ b/repos/base-foc/lib/mk/syscall-foc.inc @@ -57,3 +57,21 @@ $(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) + +# +# Install sigma0 and bootstap to /bin such that the binaries will be +# included in the depot's base-foc binary archives. +# +ifneq ($(INSTALL_DIR),) +all: $(INSTALL_DIR)/sigma0-foc $(INSTALL_DIR)/bootstrap-foc + +$(INSTALL_DIR)/sigma0-foc $(INSTALL_DIR)/bootstrap-foc: $(PKG_TAGS) + +$(INSTALL_DIR)/sigma0-foc: + $(VERBOSE)ln -sf $(L4_BIN_DIR)/l4f/sigma0 $@ + +$(INSTALL_DIR)/bootstrap-foc: + $(VERBOSE)ln -sf $(L4_BIN_DIR)/bootstrap $@ +endif + + diff --git a/repos/base-foc/src/kernel/foc/target.mk b/repos/base-foc/src/kernel/foc/target.mk index e529384c8d..e244ea76d9 100644 --- a/repos/base-foc/src/kernel/foc/target.mk +++ b/repos/base-foc/src/kernel/foc/target.mk @@ -1,2 +1,7 @@ TARGET = kernel-foc LIBS = kernel-foc + +$(TARGET): $(INSTALL_DIR)/foc + +$(INSTALL_DIR)/foc: $(LIB_CACHE_DIR)/kernel-foc/build/fiasco + $(VERBOSE)ln -sf $< $@ diff --git a/tool/run/boot_dir/fiasco b/tool/run/boot_dir/fiasco index 84d3659cb4..4aaf6314b0 100644 --- a/tool/run/boot_dir/fiasco +++ b/tool/run/boot_dir/fiasco @@ -2,6 +2,7 @@ proc binary_name_ld_lib_so { } { return "ld-fiasco.lib.so" } proc binary_name_core_o { } { return "core-fiasco.o" } proc binary_name_timer { } { return "fiasco_timer_drv" } +proc kernel_files { } { return { fiasco sigma0-fiasco bootstrap-fiasco } } proc fiasco_serial_esc_arg { } { return "-serial_esc " } proc run_boot_string { } { return "\nL4 Bootstrapper" } @@ -17,10 +18,9 @@ proc run_boot_dir {binaries} { build_core_image $binaries - exec mkdir -p [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 + file copy -force kernel/fiasco/kernel [run_dir]/kernel + file copy -force kernel/fiasco/sigma0 [run_dir]/sigma0 + file copy -force kernel/fiasco/bootstrap [run_dir]/bootstrap if {[have_include "image/iso"] || [have_include "image/disk"]} { @@ -40,9 +40,9 @@ proc run_boot_dir {binaries} { puts $fh "default 0" puts $fh "\ntitle Genode on L4/Fiasco" puts $fh " kernel /boot/bender" - puts $fh " module /fiasco/bootstrap -serial" - puts $fh " module /fiasco/kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]" - puts $fh " module /fiasco/sigma0" + puts $fh " module /bootstrap -serial" + puts $fh " module /kernel -serial -jdb_cmd=JH [fiasco_serial_esc_arg]" + puts $fh " module /sigma0" puts $fh " module /image.elf" puts $fh " vbeset 0x117 506070" close $fh @@ -61,9 +61,9 @@ 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/kernel -serial -serial_esc -jdb_cmd=JH" - puts $fh " load /fiasco/sigma0" + puts $fh " load /bootstrap -serial" + puts $fh " load /kernel -serial -serial_esc -jdb_cmd=JH" + puts $fh " load /sigma0" puts $fh " load /image.elf" close $fh diff --git a/tool/run/boot_dir/foc b/tool/run/boot_dir/foc index 72d2bdcd5f..12007d8806 100644 --- a/tool/run/boot_dir/foc +++ b/tool/run/boot_dir/foc @@ -2,6 +2,7 @@ proc binary_name_ld_lib_so { } { return "ld-foc.lib.so" } proc binary_name_core_o { } { return "core-foc.o" } proc binary_name_timer { } { return "foc_timer_drv" } +proc kernel_files { } { return { foc sigma0-foc bootstrap-foc } } proc run_boot_string { } { return "\nL4 Bootstrapper" } @@ -39,7 +40,7 @@ proc reset_target { {spawn_id_arg -1} } { proc l4_build_dir { } { return "[pwd]/var/libcache/syscall-foc/build" } -proc kernel_binary { } { return "[pwd]/var/libcache/kernel-foc/build/fiasco" } +proc kernel_binary { } { return "[pwd]/bin/foc" } proc l4_bin_dir { } { @@ -60,10 +61,9 @@ proc run_boot_dir_x86 {binaries} { build_core_image $binaries - 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 + file copy -force [pwd]/bin/foc [run_dir]/kernel + file copy -force [pwd]/bin/sigma0-foc [run_dir]/sigma0 + file copy -force [pwd]/bin/bootstrap-foc [run_dir]/bootstrap if {[have_include "image/iso"] || [have_include "image/disk"]} { @@ -83,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 /foc/bootstrap" - puts $fh " module /foc/kernel [fiasco_serial_esc_arg]" - puts $fh " module /foc/sigma0" + puts $fh " module /bootstrap" + puts $fh " module /kernel [fiasco_serial_esc_arg]" + puts $fh " module /sigma0" puts $fh " module /image.elf" close $fh } @@ -106,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 /foc/bootstrap" - puts $fh " load /foc/kernel -serial_esc" - puts $fh " load /foc/sigma0" + puts $fh " load /bootstrap" + puts $fh " load /kernel -serial_esc" + puts $fh " load /sigma0" puts $fh " load /image.elf" close $fh