2012-10-10 15:31:22 +00:00
|
|
|
#
|
|
|
|
# \brief Virtual-machine monitor demo
|
|
|
|
# \author Stefan Kalkowski
|
2015-02-24 23:02:36 +00:00
|
|
|
# \author Martin Stein
|
2012-10-10 15:31:22 +00:00
|
|
|
# \date 2012-06-25
|
|
|
|
#
|
|
|
|
|
2015-02-24 15:31:50 +00:00
|
|
|
assert_spec hw
|
2021-07-26 10:41:08 +00:00
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
if {![have_board imx53_qsb_tz]} {
|
2021-07-26 10:41:08 +00:00
|
|
|
|
|
|
|
puts "\n Run script is not supported on this platform. \n"
|
|
|
|
exit 0
|
|
|
|
}
|
2012-10-10 15:31:22 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build { core init lib/ld server/tz_vmm }
|
2015-11-02 13:34:49 +00:00
|
|
|
|
2012-10-10 15:31:22 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
2015-11-02 13:34:49 +00:00
|
|
|
# compose config
|
2021-07-26 10:53:26 +00:00
|
|
|
install_config {
|
2012-10-10 15:31:22 +00:00
|
|
|
<config verbose="yes">
|
2021-07-26 10:53:26 +00:00
|
|
|
|
2012-10-10 15:31:22 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
2015-11-02 13:34:49 +00:00
|
|
|
<service name="IO_PORT"/>
|
2012-10-10 15:31:22 +00:00
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="VM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service><any-child/><parent/></any-service>
|
2017-05-07 20:36:11 +00:00
|
|
|
</default-route>
|
2021-07-26 10:53:26 +00:00
|
|
|
<default caps="100"/>
|
2015-11-02 13:34:49 +00:00
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
<start name="imx53_qsb_tz_vmm">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
2020-09-24 14:07:27 +00:00
|
|
|
</start>
|
|
|
|
|
2015-11-02 13:34:49 +00:00
|
|
|
</config> }
|
|
|
|
|
|
|
|
# download and add linux
|
|
|
|
cd bin
|
2021-07-26 10:53:26 +00:00
|
|
|
set linux_uri "http://genode.org/files/images/imx53_qsb/linux_trustzone.bin"
|
2015-11-02 13:34:49 +00:00
|
|
|
if {![file exists linux]} {
|
|
|
|
puts "Download linux binary ..."
|
|
|
|
exec >& /dev/null wget -c -O linux $linux_uri
|
|
|
|
}
|
|
|
|
exec >& /dev/null wget -O linux.md5 $linux_uri.md5
|
|
|
|
exec md5sum -c linux.md5
|
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
# download and add initrd
|
|
|
|
set initrd_uri "http://genode.org/files/images/imx53_qsb/initrd.gz"
|
|
|
|
if {![file exists initrd.gz]} {
|
|
|
|
puts "Download initramfs ..."
|
|
|
|
exec >& /dev/null wget -c -O initrd.gz $initrd_uri
|
2013-11-27 16:12:39 +00:00
|
|
|
}
|
2021-07-26 10:53:26 +00:00
|
|
|
exec >& /dev/null wget -O initrd.gz.md5 $initrd_uri.md5
|
|
|
|
exec md5sum -c initrd.gz.md5
|
2013-11-27 16:12:39 +00:00
|
|
|
cd ..
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build_boot_image [list {*}[build_artifacts] linux initrd.gz]
|
2013-11-27 10:58:35 +00:00
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
# execute and wait for console
|
|
|
|
run_genode_until {.*\/ #.*} 220
|
|
|
|
set serial_id [output_spawn_id]
|
2014-06-24 09:48:25 +00:00
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
# wait for network to settle down
|
|
|
|
send -i $serial_id "sleep 5\n"
|
2014-06-24 09:48:25 +00:00
|
|
|
|
2021-07-26 10:53:26 +00:00
|
|
|
# test network
|
|
|
|
send -i $serial_id "ping 1.1.1.1\n"
|
|
|
|
run_genode_until "64 bytes from 1.1.1.1:.*\n" 30 $serial_id
|