2016-12-09 22:09:17 +00:00
|
|
|
proc binary_name_ld_lib_so { } { return "ld-nova.lib.so" }
|
2017-04-05 08:18:35 +00:00
|
|
|
proc binary_name_core_o { } { return "core-nova.o" }
|
2016-12-10 22:22:13 +00:00
|
|
|
proc binary_name_timer { } { return "nova_timer_drv" }
|
2016-12-09 22:09:17 +00:00
|
|
|
|
2017-04-03 13:39:36 +00:00
|
|
|
proc kernel_files { } { return hypervisor }
|
2015-01-08 21:08:48 +00:00
|
|
|
|
|
|
|
|
2015-02-06 17:02:55 +00:00
|
|
|
proc run_boot_string { } {
|
2016-07-13 12:19:57 +00:00
|
|
|
return "\n\r\fNOVA Microhypervisor"
|
2015-02-06 17:02:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-09-15 14:08:33 +00:00
|
|
|
proc core_link_address { } { return "0x100000" }
|
|
|
|
|
2017-04-03 13:39:36 +00:00
|
|
|
|
2016-09-15 14:08:33 +00:00
|
|
|
proc core_ld_opts { } {
|
|
|
|
set ret { -Wl,-T }
|
|
|
|
lappend ret "-Wl,[genode_dir]/repos/base/src/ld/genode.ld"
|
|
|
|
lappend ret "-Wl,[genode_dir]/repos/base-nova/src/core/core-bss.ld"
|
|
|
|
return $ret
|
|
|
|
}
|
|
|
|
|
2015-01-08 21:08:48 +00:00
|
|
|
##
|
|
|
|
# Populate directory with binaries on NOVA
|
|
|
|
#
|
|
|
|
proc run_boot_dir {binaries} {
|
2015-05-12 14:54:06 +00:00
|
|
|
|
2017-04-03 13:39:36 +00:00
|
|
|
#
|
|
|
|
# Build kernel-specific targets if needed
|
|
|
|
#
|
|
|
|
# If the run scripts imports the base-nova binary archive, [run_dir] is
|
|
|
|
# already populated, so we can skip the build.
|
|
|
|
#
|
|
|
|
set kernel_arg ""
|
|
|
|
set core_arg ""
|
|
|
|
set ld_arg ""
|
|
|
|
if {![file exists [run_dir]/genode/hypervisor]} { set kernel_arg kernel }
|
|
|
|
if {![file exists [run_dir]/genode/core-nova.o]} { set core_arg core/nova }
|
|
|
|
if {![file exists [run_dir]/genode/ld.lib.so]} { set ld_arg lib/ld/nova }
|
|
|
|
|
|
|
|
set targets "$kernel_arg $core_arg $ld_arg"
|
|
|
|
if {[llength $targets]} { build $targets }
|
|
|
|
|
|
|
|
if {$kernel_arg != ""} { file copy -force bin/hypervisor [run_dir]/genode/hypervisor }
|
2017-06-16 20:27:40 +00:00
|
|
|
if {$core_arg != ""} { file copy -force bin/core-nova.o [run_dir]/genode/core-nova.o }
|
2017-04-03 13:39:36 +00:00
|
|
|
if {$ld_arg != ""} { file copy -force bin/ld-nova.lib.so [run_dir]/genode/ld.lib.so }
|
2016-12-09 22:09:17 +00:00
|
|
|
|
2015-01-08 21:08:48 +00:00
|
|
|
#
|
|
|
|
# Collect contents of the ISO image
|
|
|
|
#
|
2016-09-15 14:08:33 +00:00
|
|
|
build_core_image $binaries
|
2015-01-08 21:08:48 +00:00
|
|
|
|
2017-04-03 13:39:36 +00:00
|
|
|
exec [cross_dev_prefix]objcopy -O elf32-i386 [run_dir]/genode/hypervisor [run_dir]/hypervisor
|
2015-09-04 10:21:32 +00:00
|
|
|
exec [cross_dev_prefix]strip [run_dir]/hypervisor
|
2015-01-08 21:08:48 +00:00
|
|
|
|
2017-04-03 13:39:36 +00:00
|
|
|
exec rm -rf [run_dir]/genode
|
|
|
|
|
2017-06-12 20:12:11 +00:00
|
|
|
if {[have_include "image/iso"] || [have_include "image/disk"] || [have_include image/uefi]} {
|
2017-09-09 10:11:28 +00:00
|
|
|
#
|
|
|
|
# Compress Genode image, to be uncompressed by GRUB
|
|
|
|
#
|
|
|
|
exec gzip [run_dir]/image.elf
|
|
|
|
|
2017-06-12 20:12:11 +00:00
|
|
|
if {[have_include "image/iso"] || [have_include "image/disk"]} {
|
2017-09-09 10:11:28 +00:00
|
|
|
|
2017-06-12 20:12:11 +00:00
|
|
|
# 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"
|
|
|
|
puts $fh "\ntitle Genode on NOVA"
|
|
|
|
puts $fh " kernel /boot/bender"
|
|
|
|
puts $fh " module /hypervisor iommu serial novpid novga"
|
2017-09-09 10:11:28 +00:00
|
|
|
puts $fh " module /image.elf.gz"
|
2017-06-12 20:12:11 +00:00
|
|
|
close $fh
|
|
|
|
}
|
|
|
|
|
|
|
|
if {[have_include image/uefi]} {
|
|
|
|
exec mkdir -p [run_dir]/efi/boot
|
|
|
|
exec cp [genode_dir]/tool/boot/grub2_32.efi [run_dir]/efi/boot/bootia32.efi
|
|
|
|
exec cp [genode_dir]/tool/boot/grub2_64.efi [run_dir]/efi/boot/bootx64.efi
|
|
|
|
exec mkdir -p [run_dir]/boot/grub
|
|
|
|
exec cp [genode_dir]/tool/boot/bender [run_dir]/boot/bender
|
|
|
|
}
|
2015-01-08 21:08:48 +00:00
|
|
|
|
|
|
|
#
|
2017-06-12 20:12:11 +00:00
|
|
|
# Generate GRUB2 config file
|
2015-01-08 21:08:48 +00:00
|
|
|
#
|
2017-06-12 20:12:11 +00:00
|
|
|
set fh [open "[run_dir]/boot/grub/grub.cfg" "WRONLY CREAT TRUNC"]
|
|
|
|
puts $fh "set timeout=0"
|
2017-10-30 13:05:07 +00:00
|
|
|
# tell grub2 to prefer 32bit framebuffer resolution
|
|
|
|
puts $fh "set gfxpayload=\"0x0x32\""
|
2017-06-12 20:12:11 +00:00
|
|
|
puts $fh "menuentry 'Genode on NOVA' {"
|
|
|
|
puts $fh " multiboot2 /boot/bender serial_fallback"
|
|
|
|
puts $fh " module2 /hypervisor hypervisor iommu serial novpid novga"
|
2017-09-09 10:11:28 +00:00
|
|
|
puts $fh " module2 /image.elf.gz image.elf"
|
2017-06-12 20:12:11 +00:00
|
|
|
puts $fh "}"
|
2015-01-08 21:08:48 +00:00
|
|
|
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"
|
2016-10-10 12:14:07 +00:00
|
|
|
puts $fh " load /hypervisor iommu serial novpid novga"
|
2016-09-15 14:08:33 +00:00
|
|
|
puts $fh " load /image.elf"
|
2015-01-08 21:08:48 +00:00
|
|
|
close $fh
|
|
|
|
|
|
|
|
generate_tftp_config
|
|
|
|
}
|
2015-08-27 17:03:57 +00:00
|
|
|
|
|
|
|
if {[have_include "load/ipxe"]} {
|
|
|
|
create_ipxe_iso_config
|
|
|
|
update_ipxe_boot_dir
|
|
|
|
create_symlink_for_iso
|
|
|
|
}
|
2015-01-08 21:08:48 +00:00
|
|
|
}
|
2017-03-29 14:04:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# Base source archive within depot
|
|
|
|
#
|
|
|
|
proc base_src { } { return base-nova }
|
|
|
|
|