Stefan Kalkowski 7e1692d997 core: unify handling of boot modules
Instead of solving the problem to deliver ROM modules to core while booting
differently for the several kernels (multi-boot, elfweaver, core re-linking),
this commit unifies the approaches. It always builds core as a library, and
after all binaries are built from a run-script, the run-tool will link an
ELF image out of the core-library and all boot modules. Thereby, core can
access its ROM modules directly.

This approach now works for all kernels except Linux.

With this solution, there is no [build_dir]/bin/core binary available anymore.
For debugging purposes you will find a core binary without boot modules, but
with debug symbols under [run_dir].core.

Fix #2095
2016-11-08 15:26:27 +01:00

114 lines
2.8 KiB
Plaintext

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_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
}
}