proc platform_supported { } { if {[have_spec x86_64] && [have_board pc]} { if {[have_spec nova] || [have_spec hw]} { return 1 } } elseif {[have_spec arm_v8a] && [have_board rpi3] && [have_include power_on/qemu]} { if {[have_spec hw]} { return 1 } } return 0 } if {![platform_supported]} { puts "Run script is not supported on this platform" exit 0 } create_boot_directory import_from_depot [depot_user]/src/[base_src] \ [depot_user]/src/init \ [depot_user]/src/sandbox \ [depot_user]/src/monitor set build_components { test/monitor_gdb test/log } if {[have_include power_on/qemu]} { append build_components { drivers/uart } } else { import_from_depot [depot_user]/pkg/[drivers_nic_pkg] \ [depot_user]/src/nic_router \ [depot_user]/src/vfs \ [depot_user]/src/vfs_lwip \ [depot_user]/src/vfs_pipe append build_components { server/tcp_terminal lib/libc lib/libm } } build $build_components append config { } if { [have_include power_on/qemu] } { append_if [have_board pc] config { } append_if [have_board rpi3] config { } } else { append config { } } append config { } install_config $config build_boot_image [build_artifacts] set port 5555 if {[have_include power_on/qemu]} { set host "localhost" # qemu config append qemu_args " -display none " if {[have_board rpi3]} { # connect comport 0 with TCP port $port append qemu_args " -serial chardev:uart " # connect comport 1 to stdio append qemu_args " -serial stdio " } else { # connect comport 0 to stdio append qemu_args " -serial stdio " # connect comport 1 with TCP port $port append qemu_args " -serial chardev:uart " } append qemu_args " -chardev socket,id=uart,port=$port,host=$host,server,nowait,ipv4 " run_genode_until {.*monitor ready*} 30 } else { set match_string "nic_router. .uplink. dynamic IP config: interface .*\n" run_genode_until $match_string 30 regexp $match_string $output host regexp {[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} $host host } set genode_id [output_spawn_id] # GDB loads symbols from 'debug/ld.lib.so' if { [have_spec nova] } { exec ln -sf ld-nova.lib.so debug/ld.lib.so } elseif { [have_spec hw] } { exec ln -sf ld-hw.lib.so debug/ld.lib.so }