2015-01-14 11:18:16 +00:00
|
|
|
if {[have_spec arm]} {
|
|
|
|
assert_spec arm_v7
|
|
|
|
}
|
|
|
|
|
2013-12-05 14:45:14 +00:00
|
|
|
#
|
|
|
|
# Check used commands
|
|
|
|
#
|
2018-06-19 17:55:04 +00:00
|
|
|
set mkfs [installed_command mkfs.vfat]
|
|
|
|
set dd [installed_command dd]
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2019-01-06 20:17:07 +00:00
|
|
|
server/ram_block
|
2013-12-05 14:45:14 +00:00
|
|
|
server/rump_fs
|
2014-04-14 09:57:22 +00:00
|
|
|
test/libc_vfs
|
2013-12-05 14:45:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build FAT-file-system image
|
|
|
|
#
|
|
|
|
catch { exec $dd if=/dev/zero of=bin/fs.raw bs=1M count=16 }
|
2014-08-14 15:16:06 +00:00
|
|
|
catch { exec $mkfs -F16 bin/fs.raw }
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
append config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-11-14 15:03:16 +00:00
|
|
|
<default caps="100"/>
|
2013-12-05 14:45:14 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2019-01-06 20:17:07 +00:00
|
|
|
<start name="ram_block">
|
2013-12-05 14:45:14 +00:00
|
|
|
<resource name="RAM" quantum="20M"/>
|
|
|
|
<provides><service name="Block"/></provides>
|
|
|
|
<config file="fs.raw" block_size="512"/>
|
|
|
|
</start>
|
2017-11-14 15:03:16 +00:00
|
|
|
<start name="rump_fs" caps="200">
|
2018-06-19 17:55:04 +00:00
|
|
|
<resource name="RAM" quantum="10M" />
|
2013-12-05 14:45:14 +00:00
|
|
|
<provides><service name="File_system"/></provides>
|
2016-03-09 14:32:23 +00:00
|
|
|
<config fs="msdos"><default-policy root="/" writeable="yes"/></config>
|
2013-12-05 14:45:14 +00:00
|
|
|
</start>
|
2014-04-14 09:57:22 +00:00
|
|
|
<start name="test-libc_vfs">
|
2013-12-05 14:45:14 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2014-04-14 09:57:22 +00:00
|
|
|
<config>
|
|
|
|
<libc stdout="/dev/log">
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<fs/>
|
|
|
|
</vfs>
|
|
|
|
</libc>
|
|
|
|
</config>
|
2013-12-05 14:45:14 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2019-01-06 20:17:07 +00:00
|
|
|
core ld.lib.so init timer test-libc_vfs ram_block
|
2013-12-05 14:45:14 +00:00
|
|
|
rump.lib.so rump_fs.lib.so rump_fs
|
2018-04-23 08:49:21 +00:00
|
|
|
fs.raw libc.lib.so vfs.lib.so
|
2013-12-05 14:45:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args " -nographic "
|
2013-12-05 14:45:14 +00:00
|
|
|
|
2014-08-22 12:43:54 +00:00
|
|
|
run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60
|
2013-12-05 14:45:14 +00:00
|
|
|
|
|
|
|
exec rm -f bin/fs.raw
|
|
|
|
puts "\nTest succeeded\n"
|