proc platform_supported { } { if {[have_board pc]} { return 1 } elseif {[have_board rpi3] && [have_include power_on/qemu]} { 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/terminal_crosslink \ [depot_user]/src/vfs \ [depot_user]/src/fs_rom \ [depot_user]/src/libc \ [depot_user]/src/posix \ [depot_user]/src/socat \ [depot_user]/src/test-terminal_echo if {[have_include power_on/qemu]} { build { driver/uart } } else { import_from_depot [depot_user]/pkg/[drivers_nic_pkg] \ [depot_user]/src/nic_router \ [depot_user]/src/vfs_lwip } 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 { 2018-01-01 00:01 } append_if [have_include power_on/qemu] config { } append config { } if {![have_include power_on/qemu]} { append config { } } append config { } if {[have_include power_on/qemu]} { append 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 {\[init -> uart\].*\n} 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 } # wait a moment for all components to become ready after 2000 set genode_id [output_spawn_id] eval spawn socat - TCP:$host:$port set host_socat_id [list $spawn_id $genode_id] send "test message\n" # echo of input by host socat run_genode_until {test message} 10 $host_socat_id # log message from test-terminal_echo run_genode_until {got 13 byte} 10 $genode_id # intro message from test-terminal_echo run_genode_until {--- Terminal echo test started - now you can type characters to be echoed. ---} 10 $host_socat_id # echo from test-terminal_echo run_genode_until {test message} 10 $host_socat_id