Files
genode-Tests/run/swcr.run

96 lines
2.3 KiB
Plaintext

#
# Build
#
set use_usb_driver [expr [have_spec omap4] || [have_spec arndale] || [have_spec rpi]]
set use_nic_driver [expr !$use_usb_driver && ![have_spec odroid_xu] && ![have_spec linux]]
if {[expr !$use_usb_driver && !$use_nic_driver] ||
[expr [have_spec imx53] && [have_spec trustzone]]} {
puts "\n Run script is not supported on this platform. \n"; exit 0 }
set build_components {
core init
drivers/timer drivers/nic
app/swcr app/hello
}
lappend_if $use_usb_driver build_components drivers/usb
lappend_if [have_spec gpio] build_components drivers/gpio
proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
return gpio_drv }
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
build $build_components
create_boot_directory
#
# Generate config
#
set config {
<config verbose="yes">
<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>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="swcr" caps="300">
<resource name="RAM" quantum="8M"/>
</start>}
append_if [have_spec gpio] config "
<start name=\"[gpio_drv]\" caps=\"140\">
<resource name=\"RAM\" quantum=\"4M\"/>
<provides><service name=\"Gpio\"/></provides>
<config/>
</start>"
append_if $use_usb_driver config {
<start name="usb_drv" caps="120">
<resource name="RAM" quantum="14M"/>
<provides>
<service name="Nic"/>
</provides>
<config ehci="yes">
<nic mac="02:00:00:00:01:01" />
</config>
</start>}
append_platform_drv_config
append config {
</config>
}
install_config $config
#
# Boot image
#
build_boot_image { core ld.lib.so init swcr timer hello }
append qemu_args " -nographic "
#append_if [have_spec lan9119] qemu_args " -net nic,macaddr=02:00:00:00:01:03 -net nic,model=lan9118 -net tap,ifname=tap0,script=no "
run_genode_until forever