Files
genode/tool/run/boot_dir/hw
Norman Feske f54c85e045 Genode application binary interface (ABI)
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
2016-12-23 16:50:28 +01:00

117 lines
2.9 KiB
Plaintext

proc binary_name_ld_lib_so { } { return "ld-hw.lib.so" }
proc run_boot_string { } { return "\nkernel initialized" }
proc core_link_address { } {
if {[have_spec "hw_odroid_xu"]} { return "0x80000000" }
if {[have_spec "hw_pbxa9"]} { return "0x70000000" }
if {[have_spec "hw_usb_armory"]} { return "0x72000000" }
if {[have_spec "hw_x86_64"]} { return "0x00200000" }
if {[have_spec "hw_wand_quad"]} { return "0x10001000" }
if {[have_spec "hw_imx53_qsb"]} { return "0x70010000" }
if {[have_spec "hw_arndale"]} { return "0x80000000" }
if {[have_spec "hw_panda"]} { return "0x81000000" }
if {[have_spec "hw_zynq"]} { return "0x00100000" }
if {[have_spec "hw_riscv"]} { return "0x00000200" }
if {[have_spec "hw_rpi"]} { return "0x00800000" }
puts "unknown platform no linker address known"
exit -1
}
##
# Populate boot directory with binaries on hw
#
proc run_boot_dir {binaries} {
# generate static ACPI report for platform driver on Muen
if {[have_spec "hw_x86_64_muen"]} {
set fh [open "bin/acpi" "WRONLY CREAT TRUNC"]
puts $fh "<acpi><bdf start=\"0\" count=\"16384\" base=\"0xf8000000\"/></acpi>"
close $fh
}
build { lib/ld/hw }
build_core_image $binaries
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
#
set fh [open "[run_dir]/boot/grub/menu.lst" "WRONLY CREAT TRUNC"]
puts $fh "timeout 0"
puts $fh "default 0"
if {[have_spec "muen"]} {
puts $fh "\ntitle Genode on base-hw/Muen SK"
puts $fh " kernel /image.bin"
} else {
puts $fh "\ntitle Genode on base-hw"
puts $fh " kernel /boot/bender"
puts $fh " module /image.elf"
}
close $fh
}
run_image [run_dir]/image.elf
# set symbolic link to image.elf file in TFTP directory for PXE boot
if {[have_spec arm] && [have_include "load/tftp"]} {
exec ln -sf [run_dir]/image.elf [load_tftp_base_dir][load_tftp_offset_dir]
if {[have_include "image/uboot"]} {
exec ln -sf [pwd]/[run_dir]/uImage [load_tftp_base_dir][load_tftp_offset_dir]
}
}
if {[have_spec x86] && ![have_spec muen] && [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 /image.elf"
close $fh
generate_tftp_config
}
if {[have_spec x86] && [have_include "load/ipxe"]} {
#
# Generate iPXE config file
#
set fh [open "[run_dir]/boot.cfg" "WRONLY CREAT TRUNC"]
puts $fh "#!ipxe"
if {[have_spec "muen"]} {
puts $fh "kernel image.bin"
} else {
puts $fh "kernel boot/bender"
puts $fh "module image.elf"
#
# Install bender
#
install_bender_to_run_dir
}
puts $fh "boot"
close $fh
update_ipxe_boot_dir
}
}