genode/repos/gems/run/nano3d.run
Norman Feske 5a1cef6381 Make label prefixing more strict
This patch unconditionally applies the labeling of sessions and thereby
removes the most common use case of 'Child_policy::filter_session_args'.
Furthermore, the patch removes an ambiguity of the session labels of
sessions created by the parent of behalf of its child, e.g., the PD
session created as part of 'Child' now has the label "<child-name>"
whereas an unlabeled PD-session request originating from the child
has the label "<child-name> -> ". This way, the routing-policy of
'Child_policy::resolve_session_request' can differentiate both cases.

As a consequence, the stricter labeling must now be considered wherever
a precise label was specified as a key for a session route or a server-
side policy selection. The simplest way to adapt those cases is to use a
'label_prefix' instead of the 'label' attribute. Alternatively, the
'label' attribute may used by appending " -> " (note the whitespace).

Fixes #2171
2016-11-30 13:37:07 +01:00

148 lines
3.2 KiB
Plaintext

#
# Build
#
if {![have_spec linux]} {
puts "Runs on Linux only"
exit 0
}
set build_components {
core init
drivers/timer
server/nitpicker server/dynamic_rom app/nano3d
drivers/framebuffer
app/backdrop
}
lappend_if [have_spec usb] build_components drivers/usb
build $build_components
create_boot_directory
#
# Generate config
#
append config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<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>
<start name="fb_sdl">
<resource name="RAM" quantum="4M"/>
<provides>
<service name="Input"/>
<service name="Framebuffer"/>
</provides>
</start>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="nitpicker">
<resource name="RAM" quantum="1M"/>
<provides><service name="Nitpicker"/></provides>
<config>
<domain name="default" layer="2" content="client" label="no"/>
<domain name="nano3d" layer="1" content="client" label="no" origin="pointer"/>
<policy label_prefix="nano3d" domain="nano3d"/>
<default-policy domain="default"/>
</config>
</start>
<start name="backdrop">
<resource name="RAM" quantum="4M"/>
<config>
<libc>
<vfs>
<rom name="genode_logo.png"/>
<rom name="grid.png"/>
</vfs>
</libc>
<fill color="#122334" />
<image png="grid.png" tiled="yes" alpha="200" />
<image png="genode_logo.png" anchor="bottom_right" alpha="150"/>
</config>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="nano3d.config">
<inline description="initial state">
<config painter="textures"/>
</inline>
<sleep milliseconds="1000" />
<inline description="RGBA shading">
<config painter="shaded"/>
</inline>
<sleep milliseconds="1000" />
<inline description="switch to cube">
<config painter="shaded" shape="cube" />
</inline>
<sleep milliseconds="1000" />
<inline description="texturing">
<config painter="textured" shape="cube" />
</inline>
<sleep milliseconds="1000" />
</rom>
</config>
</start>
<start name="nano3d">
<resource name="RAM" quantum="8M"/>
<configfile name="nano3d.config"/>
<route>
<service name="ROM">
<if-arg key="label" value="nano3d.config" />
<child name="dynamic_rom" />
</service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>}
install_config $config
# copy backdrop PNG images to bin directory
foreach file { genode_logo.png grid.png } {
file copy -force [genode_dir]/repos/gems/src/app/backdrop/$file bin/ }
#
# Boot modules
#
# generic modules
set boot_modules {
core init
timer
nitpicker dynamic_rom nano3d
backdrop
ld.lib.so libpng.lib.so libc.lib.so libm.lib.so zlib.lib.so
genode_logo.png grid.png
}
# platform-specific modules
lappend_if [have_spec linux] boot_modules fb_sdl
build_boot_image $boot_modules
run_genode_until forever