2017-05-16 18:59:37 +00:00
|
|
|
#
|
2019-01-06 20:17:07 +00:00
|
|
|
# \brief Test of FatFS block-io implementation
|
2017-05-16 18:59:37 +00:00
|
|
|
# \author Emery Hemingway
|
|
|
|
# \date 2017-07-31
|
|
|
|
#
|
|
|
|
|
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
|
|
|
|
2022-04-27 11:45:53 +00:00
|
|
|
build { test/fatfs_block_io }
|
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 }
|
|
|
|
|
2022-04-27 11:45:53 +00:00
|
|
|
build_boot_image {
|
2018-04-23 08:49:21 +00:00
|
|
|
libc.lib.so vfs.lib.so
|
2017-05-16 18:59:37 +00:00
|
|
|
libm.lib.so
|
2022-04-27 11:45:53 +00:00
|
|
|
vfs_import.lib.so
|
2019-01-06 20:17:07 +00:00
|
|
|
test-fatfs_block_io
|
2022-04-27 11:45:53 +00:00
|
|
|
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
|