create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
                  [depot_user]/pkg/[drivers_nic_pkg] \
                  [depot_user]/src/init
build { proxy/udp_log test/bomb }

install_config {
<config prio_levels="2">
	<parent-provides>
		<service name="CPU"/>
		<service name="LOG"/>
		<service name="PD"/>
		<service name="RM"/>
		<service name="ROM"/>
		<service name="IO_PORT"/>
		<service name="IO_MEM"/>
		<service name="IRQ"/>
	</parent-provides>
	<default-route>
		<any-service> <parent/> <any-child/> </any-service>
	</default-route>
	<default caps="100"/>

	<start name="timer">
		<resource name="CPU" quantum="10"/>
		<resource name="RAM" quantum="1M"/>
		<provides><service name="Timer"/></provides>
	</start>

	<start name="drivers" caps="1000">
		<resource name="RAM" quantum="32M" constrain_phys="yes"/>
		<binary name="init"/>
		<route>
			<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
			<service name="Timer"> <child name="timer"/> </service>
			<any-service> <parent/> </any-service>
		</route>
		<provides> <service name="Nic"/> </provides>
	</start>

	<start name="udp_log">
		<resource name="RAM" quantum="2M"/>
		<provides><service name="LOG"/></provides>
		<config src_ip="192.168.42.10" verbose="yes">
			<default-policy ip="192.168.42.11" />
		</config>
	</start>

	<start name="bomb-master" priority="-1" caps="500">
		<binary name="bomb"/>
		<resource name="CPU" quantum="90"/>
		<resource name="RAM" quantum="1G"/>
		<route>
			<any-service> <any-child/> <parent/> </any-service>
		</route>
		<config rounds="10" generations="1" sleep="1000"/>
	</start>
</config>}

build_boot_image { bomb udp_log }

append qemu_args " -nographic"
append qemu_args " -net tap,ifname=tap0 "

run_genode_until forever
