2022-08-09 11:32:38 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2017-02-07 12:52:04 +00:00
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2022-09-01 11:12:13 +00:00
|
|
|
lib/vfs_lxip
|
2017-02-07 12:52:04 +00:00
|
|
|
server/vfs
|
|
|
|
server/dynamic_rom
|
2021-01-08 16:27:24 +00:00
|
|
|
server/nic_router
|
|
|
|
app/ping
|
2017-02-07 12:52:04 +00:00
|
|
|
}
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2017-03-09 13:03:46 +00:00
|
|
|
append config {
|
2017-02-07 12:52:04 +00:00
|
|
|
<config verbose="yes">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="ROM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2017-02-07 12:52:04 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Timer"/> </provides>
|
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<start name="ping_1">
|
|
|
|
<binary name="ping"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config interface="10.0.2.3/24"
|
|
|
|
gateway="10.0.2.1"
|
|
|
|
dst_ip="10.0.2.2"
|
|
|
|
period_sec="1"
|
|
|
|
verbose="no"
|
|
|
|
count="3"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="ping_2">
|
|
|
|
<binary name="ping"/>
|
2017-05-07 20:36:11 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
<config interface="10.0.2.4/24"
|
|
|
|
gateway="10.0.2.1"
|
|
|
|
dst_ip="10.0.2.55"
|
|
|
|
period_sec="1"
|
|
|
|
verbose="no"
|
|
|
|
count="3"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_router" caps="200">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose_domain_state="yes">
|
|
|
|
|
|
|
|
<default-policy domain="default"/>
|
|
|
|
<domain name="default" interface="10.0.2.1/24">
|
|
|
|
|
|
|
|
<dhcp-server ip_first="10.0.2.2" ip_last="10.0.2.2"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
2017-02-07 12:52:04 +00:00
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="dynamic_rom">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="socket_fs.config"><inline description="static">
|
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<lxip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1" nameserver="8.8.8.8"/>
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="2500"/> <inline description="dynamic">
|
|
|
|
<config>
|
|
|
|
<vfs>
|
2017-11-24 15:50:35 +00:00
|
|
|
<lxip mtu="1000" dhcp="yes"/>
|
2017-02-07 12:52:04 +00:00
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="2500"/>
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="socket_fs" caps="200">
|
2017-02-07 12:52:04 +00:00
|
|
|
<binary name="vfs"/>
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
|
|
|
<provides> <service name="File_system"/> </provides>
|
|
|
|
<route>
|
2020-05-08 14:21:20 +00:00
|
|
|
<service name="ROM" label="config">
|
|
|
|
<child name="dynamic_rom" label="socket_fs.config"/> </service>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2017-02-07 12:52:04 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
2017-02-07 12:52:04 +00:00
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2017-03-09 13:03:46 +00:00
|
|
|
append boot_modules {
|
2021-01-08 16:27:24 +00:00
|
|
|
core init timer vfs dynamic_rom
|
2019-04-24 13:09:49 +00:00
|
|
|
ld.lib.so vfs.lib.so vfs_lxip.lib.so lxip.lib.so
|
2021-01-08 16:27:24 +00:00
|
|
|
nic_router ping
|
2017-02-07 12:52:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
append done_string ".*\"ping_.\" exited with exit value 0.*\n"
|
|
|
|
append done_string ".*\"ping_.\" exited with exit value 0.*\n"
|
|
|
|
|
|
|
|
append qemu_args " -nographic "
|
2017-02-07 12:52:04 +00:00
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
run_genode_until $done_string 60
|
2017-02-07 12:52:04 +00:00
|
|
|
|
|
|
|
# vi: set ft=tcl :
|