#
# \brief Using Vancouver/Seoul on Genode
# \author Norman Feske
# \author Markus Partheymueller
# \author Alexander Boettcher
# \date 2011-11-21
#
# Build
#
if {![have_spec nova]} {
puts "\nSeoul is solely supported on NOVA.\n"
exit 0
}
assert_spec acpi
source ${genode_dir}/repos/base/run/platform_drv.inc
# override defaults of platform_drv.inc
proc platform_drv_priority {} { return { priority="-1"} }
set build_components {
core init
drivers/timer
drivers/rtc
drivers/input
app/seoul
}
if {$use_fancy_stuff} { set use_framebuffer 1 }
lappend_if $use_usb build_components drivers/usb
lappend_if $use_block_ram build_components server/ram_blk
lappend_if $use_block_sata build_components drivers/ahci
lappend_if $use_nic_session build_components drivers/nic
lappend_if $use_nic_bridge build_components server/nic_bridge
lappend_if $use_framebuffer build_components drivers/framebuffer
lappend_if $use_fancy_stuff build_components server/nitpicker
lappend_if $use_fancy_stuff build_components app/pointer
lappend_if $use_fancy_stuff build_components app/status_bar
lappend_if $use_fancy_stuff build_components server/liquid_framebuffer
lappend_if $use_fancy_stuff build_components app/launchpad
lappend_if $use_fancy_stuff build_components server/nitlog
lappend_if $use_fancy_stuff build_components server/report_rom
lappend_if $use_genode_iso build_components server/iso9660
lappend_if $use_genode_iso build_components server/rom_blk
append_platform_drv_build_components
build $build_components
# write Seoul config file
set vm_cfg_fd [open "bin/vm_seoul.cfg" w]
puts $vm_cfg_fd {
}
if {!$use_multiboot} {
puts $vm_cfg_fd {
}
}
puts $vm_cfg_fd {
}
if {$use_multiboot} {
if {[info exists use_multiboot_modaddr]} {
puts $vm_cfg_fd " "
} else {
puts $vm_cfg_fd { }
}
}
puts $vm_cfg_fd {
}
for {set i 0} {$i < $vcpus_to_be_used} {incr i 1} {
puts $vm_cfg_fd {
}
}
if {!$use_multiboot} {
if {$use_model_ahci} {
puts $vm_cfg_fd {
}
}
if {$use_model_ide} {
puts $vm_cfg_fd {
}
}
}
if {$use_nic_session} {
puts $vm_cfg_fd {
}
}
puts $vm_cfg_fd {
}
if {$use_multiboot} {
puts $vm_cfg_fd $multiboot_files
}
puts $vm_cfg_fd {
}
close $vm_cfg_fd
create_boot_directory
#
# Generate Genode config
#
append config {
}
append_if [expr !$use_usb] config {
}
append_if $use_block_sata config {
}
append_if $use_block_ram config {
}
append_if $use_genode_iso config {
}
append_platform_drv_config
append_if $use_nic_session config {
}
append_if [expr $use_nic_session && $use_nic_bridge] config {
}
append_if $use_framebuffer config {
}
if {!$use_fancy_stuff} {
append config {
}
append config "
"
append config {
}
append_if [expr $use_nic_session && $use_nic_bridge] config {
}
append_if [expr $use_nic_session && !$use_nic_bridge] config {
}
append_if $use_framebuffer config {
}
append_if $use_genode_iso config {
}
append config {
}
}
append_if $use_usb config {
}
append_if $use_fancy_stuff config {
}
append config {
}
#
# Generate Launchpad config file
#
if {$use_fancy_stuff} {
set launchpad_cfg_fd [open "bin/launchpad-config" w]
puts $launchpad_cfg_fd "
"
puts $launchpad_cfg_fd {
}
puts $launchpad_cfg_fd {}
close $launchpad_cfg_fd
}
install_config $config
#
# Boot modules
#
# generic modules
set boot_modules {
core ld.lib.so init
timer
rtc_drv
seoul
vm_seoul.cfg
}
lappend_if [expr !$use_usb] boot_modules ps2_drv
lappend_if $use_usb boot_modules usb_drv
lappend_if $use_block_ram boot_modules ram_blk
lappend_if $use_block_sata boot_modules ahci_drv
lappend_if $use_nic_session boot_modules nic_drv
lappend_if $use_nic_bridge boot_modules nic_bridge
lappend_if $use_framebuffer boot_modules fb_drv
lappend_if $use_fancy_stuff boot_modules nitpicker
lappend_if $use_fancy_stuff boot_modules pointer
lappend_if $use_fancy_stuff boot_modules status_bar
lappend_if $use_fancy_stuff boot_modules liquid_fb
lappend_if $use_fancy_stuff boot_modules launchpad
lappend_if $use_fancy_stuff boot_modules nitlog
lappend_if $use_fancy_stuff boot_modules launchpad-config
lappend_if $use_fancy_stuff boot_modules report_rom
lappend_if $use_genode_iso boot_modules rom_blk
lappend_if $use_genode_iso boot_modules iso9660
lappend_if $use_genode_iso boot_modules genode.iso
lappend_if $use_block_ram boot_modules seoul-disc.raw
#
# Add OS binaries of guest
#
if {$use_multiboot} {
set guest_os_binary_missing 0
set binary_counter 0
foreach binary $guest_os_binaries {
if {![file exists bin/$binary]} {
puts stderr "Error: guest OS binary \"bin/$binary\" does not exist"
set guest_os_binary_missing 1
}
if {[info exists sha1_os_binaries]} {
set sha1 [exec sha1sum bin/$binary]
set sha1 [regexp -inline {[0-9a-h]+} $sha1]
if {[string compare $sha1 [lindex $sha1_os_binaries $binary_counter]]} {
puts "SHA1 sum of binary does not match with expected one - abort"
puts "$binary $sha1 != [lindex $sha1_os_binaries $binary_counter]"
set guest_os_binary_missing 1
}
}
incr binary_counter 1
}
if {$guest_os_binary_missing} { exit 1 }
append boot_modules $guest_os_binaries
}
if {$use_usb} {
append qemu_args " -usb -usbdevice mouse -usbdevice keyboard "
}
append_platform_drv_boot_modules
build_boot_image $boot_modules
# A copy of the config is placed in the run folder.
exec rm -f bin/vm_seoul.cfg