2022-04-27 11:45:53 +00:00
|
|
|
if {[expr ![have_include "power_on/qemu"] && ![have_spec linux]]} {
|
|
|
|
puts "Test only runs in Qemu or Linux.\n";
|
2017-05-16 18:59:37 +00:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2022-04-27 11:45:53 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/src/init \
|
|
|
|
[depot_user]/src/vfs_block \
|
|
|
|
[depot_user]/src/vfs_import
|
2017-05-16 18:59:37 +00:00
|
|
|
|
2023-09-12 14:21:03 +00:00
|
|
|
build { test/fatfs_block_io lib/libc lib/vfs }
|
2017-05-16 18:59:37 +00:00
|
|
|
|
2022-04-27 11:45:53 +00:00
|
|
|
install_config {
|
2017-05-16 18:59:37 +00:00
|
|
|
<config>
|
|
|
|
<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>
|
|
|
|
<default caps="128"/>
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2019-01-06 20:17:07 +00:00
|
|
|
<start name="test-fatfs_block_io">
|
2017-05-16 18:59:37 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<config ld_verbose="true">
|
|
|
|
<libc stdout="/log" stderr="/log"/>
|
|
|
|
<vfs> <log/> </vfs>
|
|
|
|
</config>
|
|
|
|
</start>
|
2020-06-18 14:27:10 +00:00
|
|
|
<start name="vfs_block">
|
2017-05-16 18:59:37 +00:00
|
|
|
<resource name="RAM" quantum="4M" />
|
|
|
|
<provides><service name="Block"/></provides>
|
2020-06-18 14:27:10 +00:00
|
|
|
<config>
|
|
|
|
<vfs>
|
|
|
|
<ram/>
|
|
|
|
<import>
|
|
|
|
<zero name="block_file" size="1M"/>
|
|
|
|
</import>
|
|
|
|
</vfs>
|
|
|
|
<default-policy file="/block_file" block_size="512"
|
|
|
|
writeable="yes"/>
|
|
|
|
</config>
|
2022-04-27 11:45:53 +00:00
|
|
|
</start>
|
2017-05-16 18:59:37 +00:00
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
set disk_image "bin/test.hda"
|
|
|
|
set cmd "dd if=/dev/zero of=$disk_image bs=512 count=4096"
|
|
|
|
puts "creating disk image: $cmd"
|
|
|
|
catch { exec sh -c $cmd }
|
|
|
|
|
2023-09-12 14:21:03 +00:00
|
|
|
build_boot_image [list {*}[build_artifacts] test.hda]
|
2017-05-16 18:59:37 +00:00
|
|
|
|
2022-04-27 11:45:53 +00:00
|
|
|
append qemu_args " -nographic "
|
2017-05-16 18:59:37 +00:00
|
|
|
|
2019-01-06 20:17:07 +00:00
|
|
|
run_genode_until {.*child "test-fatfs_block_io" exited with exit value 0.*} 60
|
2017-05-16 18:59:37 +00:00
|
|
|
|
|
|
|
exec rm -f $disk_image
|