#
# Build
#

build { core init app/fesrv }

create_boot_directory

#
# Generate config
#

install_config {
<config>
	<parent-provides>
		<service name="LOG"/>
		<service name="PD"/>
		<service name="CPU"/>
		<service name="SIGNAL"/>

		<!-- some timer implementations need kernel info pages -->
		<service name="ROM"/>

		<!-- hardware-based timers need I/O resources -->
		<service name="IO_MEM"/>
		<service name="IO_PORT"/>
		<service name="IRQ"/>
	</parent-provides>
	<default-route>
		<any-service> <parent/> <any-child/> </any-service>
	</default-route>
	<default caps="100"/>
	<start name="fesrv">
		<resource name="RAM" quantum="10M"/>
		<config>
			<fesrv image="riscv-image.elf" />
			<libc stdout="/dev/log" stderr="/dev/log" >
				<vfs>
					<rom name="riscv-image.elf"/>
				</vfs>
			</libc>
		</config>
	</start>
</config> }

#
# Boot image
#

build_boot_image { core init fesrv riscv-image.elf libm.lib.so stdcxx.lib.so libc.lib.so vfs.lib.so ld.lib.so }

append qemu_args " -nographic "

run_genode_until forever
