mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
f54c85e045
This patch decouples the kernel-specific implementation of the dynamic linker from its kernel-agnostic binary interface. The name of the kernel-specific dynamic linker binary now corresponds to the kernel, e.g., 'ld-linux.lib.so' or 'ld-nova.lib.so'. Applications are no longer linked directly against a concrete instance of the dynamic linker but against a shallow stub called 'ld.lib.so'. This stub contains nothing but the symbols provided by the dynamic linker. It thereby represents the Genode ABI. At system-integration time, the kernel-specific run/boot_dir back ends integrate the matching the kernel-specific variant of the dynamic linker as 'ld.lib.so' into the boot image. The ABI symbol file for the dynamic linker is located at 'base/lib/symbols/ld'. It contains the joint ABI of all supported architectures. The new utility 'tool/abi_symbols' eases the creation of such an ABI symbol file for a given shared library. Its result should be manually inspected and edited as needed. The patch removes the 'syscall' library from 'base_libs.mk' to avoid polluting the kernel-agnostic ABI with kernel-specific interfaces. Issue #2190 Issue #2195
141 lines
3.3 KiB
Plaintext
141 lines
3.3 KiB
Plaintext
#
|
|
# \brief Pistachio-specific test-environment supplements
|
|
# \author Norman Feske
|
|
# \date 2010-08-25
|
|
#
|
|
# This file is meant to be used as '--include' argument for 'tool/run'.
|
|
#
|
|
|
|
proc binary_name_ld_lib_so { } { return "ld-pistachio.lib.so" }
|
|
|
|
|
|
##
|
|
# Install files needed to boot via PXE
|
|
#
|
|
proc install_pxe_bootloader_to_run_dir { } {
|
|
exec cp [genode_dir]/tool/boot/pulsar [run_dir]/boot/pulsar
|
|
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
|
|
}
|
|
|
|
|
|
##
|
|
# 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_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
|
|
|
|
if {[have_include "image/iso"] || [have_include "image/disk"]} {
|
|
#
|
|
# Install isolinux/GRUB files and bender
|
|
#
|
|
install_iso_bootloader_to_run_dir
|
|
|
|
#
|
|
# Generate grub config file
|
|
#
|
|
# The core binary is part of the 'binaries' list but it must
|
|
# appear right after 'sigma0' as boot module. Hence the special case.
|
|
#
|
|
set fh [open "[run_dir]/boot/grub/menu.lst" "WRONLY CREAT TRUNC"]
|
|
puts $fh "timeout 0"
|
|
puts $fh "default 0"
|
|
puts $fh "\ntitle Genode on L4ka::Pistachio"
|
|
puts $fh " kernel /pistachio/kickstart"
|
|
puts $fh " module /pistachio/kernel"
|
|
puts $fh " module /pistachio/sigma0"
|
|
puts $fh " module /image.elf"
|
|
close $fh
|
|
}
|
|
|
|
#
|
|
# Build image
|
|
#
|
|
run_image
|
|
|
|
if {[have_include "load/tftp"]} {
|
|
#
|
|
# Install PXE bootloader pulsar
|
|
#
|
|
install_pxe_bootloader_to_run_dir
|
|
|
|
#
|
|
# Generate pulsar config file
|
|
#
|
|
set fh [open "[run_dir]/config-52-54-00-12-34-56" "WRONLY CREAT TRUNC"]
|
|
puts $fh " exec /boot/bender"
|
|
puts $fh " load /pistachio/kickstart"
|
|
puts $fh " load /pistachio/kernel"
|
|
puts $fh " load /pistachio/sigma0"
|
|
puts $fh " load /image.elf"
|
|
close $fh
|
|
|
|
generate_tftp_config
|
|
}
|
|
}
|