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
|
2015-09-03 12:55:05 +00:00
|
|
|
assert_spec imx53
|
2014-06-24 09:48:25 +00:00
|
|
|
assert_spec trustzone
|
2012-10-10 15:31:22 +00:00
|
|
|
|
2013-11-27 10:58:35 +00:00
|
|
|
build "core init server/tz_vmm"
|
2012-10-10 15:31:22 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config verbose="yes">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="RAM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="CAP"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="SIGNAL"/>
|
|
|
|
<service name="VM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service><any-child/><parent/></any-service>
|
|
|
|
</default-route>
|
2013-11-27 10:58:35 +00:00
|
|
|
<start name="tz_vmm">
|
2012-10-10 15:31:22 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
2015-02-24 23:02:36 +00:00
|
|
|
set init_uri "http://genode.org/files/images/imx53_qsb/initrd.gz"
|
|
|
|
|
|
|
|
if {[have_spec hw_usb_armory]} {
|
|
|
|
#
|
|
|
|
# This Linux and DTB were build with this toolchain:
|
|
|
|
#
|
|
|
|
# ! http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_linux.tar.xz
|
|
|
|
#
|
|
|
|
# From this sources:
|
|
|
|
#
|
|
|
|
# ! https://github.com/m-stein/linux/tree/usb_armory_genode_tz_vmm
|
|
|
|
#
|
|
|
|
# With the following commands:
|
|
|
|
#
|
|
|
|
# ! make ARCH=arm CROSS_COMPILE=$GCC/bin/arm-none-eabi- imx_v53_usb_armory_defconfig
|
|
|
|
# ! make ARCH=arm CROSS_COMPILE=$GCC/bin/arm-none-eabi- zImage LOADADDR=0x80008000
|
|
|
|
# ! make ARCH=arm CROSS_COMPILE=$GCC/bin/arm-none-eabi- dtbs
|
|
|
|
#
|
|
|
|
# Then 'arch/arm/boot/zImage' can be used as 'linux' and
|
|
|
|
# 'arch/arm/boot/dts/imx53-qsb.dtb' can be used as 'dtb'.
|
|
|
|
#
|
|
|
|
set linux_uri "https://github.com/m-stein/genode_binaries/raw/master/tz_vmm/imx53/linux"
|
|
|
|
set dtb_uri "https://github.com/m-stein/genode_binaries/raw/master/tz_vmm/imx53/dtb"
|
|
|
|
|
|
|
|
if {![file exists bin/dtb]} {
|
|
|
|
puts "Download device tree ..."
|
|
|
|
exec >& /dev/null wget -c -O bin/dtb $dtb_uri
|
|
|
|
}
|
|
|
|
exec >& /dev/null wget -O bin/dtb.md5 $dtb_uri.md5
|
|
|
|
} elseif {[have_spec hw_imx53_qsb_tz]} {
|
|
|
|
set linux_uri "http://genode.org/files/images/imx53_qsb/linux_trustzone.bin"
|
|
|
|
}
|
2014-06-24 09:48:25 +00:00
|
|
|
|
2013-11-27 16:12:39 +00:00
|
|
|
if {![file exists bin/initrd.gz]} {
|
|
|
|
puts "Download initramfs ..."
|
|
|
|
exec >& /dev/null wget -c -O bin/initrd.gz $init_uri
|
|
|
|
}
|
|
|
|
if {![file exists bin/linux]} {
|
|
|
|
puts "Download linux binary ..."
|
|
|
|
exec >& /dev/null wget -c -O bin/linux $linux_uri
|
|
|
|
}
|
|
|
|
exec >& /dev/null wget -O bin/initrd.gz.md5 $init_uri.md5
|
|
|
|
exec >& /dev/null wget -O bin/linux.md5 $linux_uri.md5
|
|
|
|
cd bin
|
2015-02-24 23:02:36 +00:00
|
|
|
if {[have_spec hw_usb_armory]} { exec md5sum -c dtb.md5 }
|
2013-11-27 16:12:39 +00:00
|
|
|
exec md5sum -c initrd.gz.md5
|
|
|
|
exec md5sum -c linux.md5
|
|
|
|
cd ..
|
|
|
|
|
2015-02-24 23:02:36 +00:00
|
|
|
set boot_modules { core init tz_vmm linux initrd.gz }
|
|
|
|
lappend_if [have_spec hw_usb_armory] boot_modules dtb
|
|
|
|
build_boot_image [join $boot_modules " "]
|
2013-11-27 10:58:35 +00:00
|
|
|
|
2014-06-24 09:48:25 +00:00
|
|
|
#
|
|
|
|
# Execute test case
|
|
|
|
#
|
|
|
|
run_genode_until {.*\/ #.*} 220
|
2015-02-03 12:29:44 +00:00
|
|
|
set serial_id [output_spawn_id]
|
2014-06-24 09:48:25 +00:00
|
|
|
|
|
|
|
# Wait for network to settle down
|
2015-02-03 12:29:44 +00:00
|
|
|
send -i $serial_id "sleep 5\n"
|
|
|
|
send -i $serial_id "wget http://genode.org/\n"
|
2015-02-24 14:48:03 +00:00
|
|
|
run_genode_until "Connecting to genode.org" 10 $serial_id
|
|
|
|
run_genode_until {.*\/ #.*} 30 $serial_id
|
2014-06-24 09:48:25 +00:00
|
|
|
|
|
|
|
exec rm bin/initrd.gz bin/initrd.gz.md5 bin/linux bin/linux.md5
|
2015-02-24 23:02:36 +00:00
|
|
|
if {[have_spec hw_usb_armory]} { exec rm bin/dtb bin/dtb.md5 }
|