Share common parts of simple interactive scenaros
By moving the common run-script parts to framebuffer_app.inc, we avoid the duplication of the application-agnostic run-script content.
This commit is contained in:
137
run/framebuffer_app.inc
Normal file
137
run/framebuffer_app.inc
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
#
|
||||||
|
# This is a skeleton for simple interactive system scenarios that solely rely
|
||||||
|
# on a framebuffer and input device. The following variables should/can be
|
||||||
|
# defined prior including this file:
|
||||||
|
#
|
||||||
|
# fb_config - optional XML config to be passed to the fb_drv
|
||||||
|
# build_components - application-specific build supplements
|
||||||
|
# boot_modules - application-specific boot modules
|
||||||
|
# app_config - start node(s) of init for running the application
|
||||||
|
#
|
||||||
|
|
||||||
|
if {![info exists fb_config]} {
|
||||||
|
set fb_config {<config buffered="yes" width="640" height="480"/>} }
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build
|
||||||
|
#
|
||||||
|
|
||||||
|
append build_components {
|
||||||
|
core init
|
||||||
|
drivers/timer
|
||||||
|
drivers/framebuffer drivers/platform drivers/input
|
||||||
|
}
|
||||||
|
|
||||||
|
lappend_if [have_spec usb] build_components drivers/usb
|
||||||
|
|
||||||
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||||
|
# override default platform driver policy
|
||||||
|
proc platform_drv_policy {} {
|
||||||
|
return {
|
||||||
|
<policy label="ps2_drv"> <device name="PS2"/> </policy>
|
||||||
|
<policy label="usb_drv"> <pci class="USB"/> </policy>
|
||||||
|
<policy label="fb_drv"> <pci class="VGA"/> </policy>
|
||||||
|
<policy label="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>}
|
||||||
|
}
|
||||||
|
|
||||||
|
append_platform_drv_build_components
|
||||||
|
|
||||||
|
build $build_components
|
||||||
|
|
||||||
|
create_boot_directory
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate config
|
||||||
|
#
|
||||||
|
|
||||||
|
append config {
|
||||||
|
<config prio_levels="4">
|
||||||
|
<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>}
|
||||||
|
|
||||||
|
append_platform_drv_config
|
||||||
|
|
||||||
|
if {[have_spec sdl]} {
|
||||||
|
append config {
|
||||||
|
<start name="fb_sdl">
|
||||||
|
<resource name="RAM" quantum="4M"/>
|
||||||
|
<provides>
|
||||||
|
<service name="Input"/>
|
||||||
|
<service name="Framebuffer"/>
|
||||||
|
</provides>}
|
||||||
|
append config $fb_config
|
||||||
|
append config {
|
||||||
|
</start>}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[have_spec framebuffer]} {
|
||||||
|
append config {
|
||||||
|
<start name="fb_drv" priority="-1">
|
||||||
|
<resource name="RAM" quantum="6M"/>
|
||||||
|
<provides><service name="Framebuffer"/></provides>}
|
||||||
|
append config $fb_config
|
||||||
|
append config {
|
||||||
|
</start>}
|
||||||
|
}
|
||||||
|
|
||||||
|
append_if [have_spec ps2] config {
|
||||||
|
<start name="ps2_drv" priority="-1">
|
||||||
|
<resource name="RAM" quantum="1M"/>
|
||||||
|
<provides><service name="Input"/></provides>
|
||||||
|
</start>}
|
||||||
|
|
||||||
|
append_if [expr ![have_spec ps2] && [have_spec usb]] config {
|
||||||
|
<start name="usb_drv">
|
||||||
|
<resource name="RAM" quantum="12M"/>
|
||||||
|
<provides><service name="Input"/></provides>
|
||||||
|
<config ehci="yes" uhci="yes" xhci="no"> <hid/> </config>
|
||||||
|
</start> }
|
||||||
|
|
||||||
|
append config {
|
||||||
|
<start name="timer">
|
||||||
|
<resource name="RAM" quantum="1M"/>
|
||||||
|
<provides><service name="Timer"/></provides>
|
||||||
|
</start>}
|
||||||
|
|
||||||
|
append config $app_config
|
||||||
|
|
||||||
|
append config {
|
||||||
|
</config>}
|
||||||
|
|
||||||
|
install_config $config
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Boot modules
|
||||||
|
#
|
||||||
|
|
||||||
|
# generic modules
|
||||||
|
append boot_modules { core init timer ld.lib.so }
|
||||||
|
|
||||||
|
# platform-specific modules
|
||||||
|
lappend_if [have_spec linux] boot_modules fb_sdl
|
||||||
|
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
||||||
|
lappend_if [have_spec ps2] boot_modules ps2_drv
|
||||||
|
lappend_if [have_spec usb] boot_modules usb_drv
|
||||||
|
|
||||||
|
append_platform_drv_boot_modules
|
||||||
|
|
||||||
|
build_boot_image $boot_modules
|
||||||
|
|
||||||
|
append qemu_args " -m 256 "
|
||||||
|
|
||||||
|
run_genode_until forever
|
||||||
112
run/ltris.run
112
run/ltris.run
@@ -1,91 +1,12 @@
|
|||||||
#
|
set build_components { app/ltris server/ram_fs }
|
||||||
# Build
|
|
||||||
#
|
|
||||||
|
|
||||||
set build_components {
|
set app_config {
|
||||||
core init
|
|
||||||
drivers/timer
|
|
||||||
app/ltris server/ram_fs
|
|
||||||
drivers/framebuffer drivers/platform drivers/input
|
|
||||||
}
|
|
||||||
|
|
||||||
lappend_if [have_spec usb] build_components drivers/usb
|
|
||||||
|
|
||||||
build $build_components
|
|
||||||
|
|
||||||
create_boot_directory
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate config
|
|
||||||
#
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<config prio_levels="4">
|
|
||||||
<parent-provides>
|
|
||||||
<service name="ROM"/>
|
|
||||||
<service name="RAM"/>
|
|
||||||
<service name="IRQ"/>
|
|
||||||
<service name="IO_MEM"/>
|
|
||||||
<service name="IO_PORT"/>
|
|
||||||
<service name="CAP"/>
|
|
||||||
<service name="PD"/>
|
|
||||||
<service name="RM"/>
|
|
||||||
<service name="CPU"/>
|
|
||||||
<service name="LOG"/>
|
|
||||||
<service name="SIGNAL"/>
|
|
||||||
</parent-provides>
|
|
||||||
<default-route>
|
|
||||||
<any-service> <parent/> <any-child/> </any-service>
|
|
||||||
</default-route>}
|
|
||||||
|
|
||||||
append_if [have_spec sdl] config {
|
|
||||||
<start name="fb_sdl">
|
|
||||||
<resource name="RAM" quantum="4M"/>
|
|
||||||
<provides>
|
|
||||||
<service name="Input"/>
|
|
||||||
<service name="Framebuffer"/>
|
|
||||||
</provides>
|
|
||||||
<config width="640" height="480"/>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec platform_rpi] config {
|
|
||||||
<start name="platform_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Platform"/></provides>
|
|
||||||
<config/>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec framebuffer] config {
|
|
||||||
<start name="fb_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="6M"/>
|
|
||||||
<provides><service name="Framebuffer"/></provides>
|
|
||||||
<config buffered="yes" width="640" height="480" />
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec ps2] config {
|
|
||||||
<start name="ps2_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [expr ![have_spec ps2] && [have_spec usb]] config {
|
|
||||||
<start name="usb_drv">
|
|
||||||
<resource name="RAM" quantum="12M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
<config ehci="yes" uhci="yes" xhci="no"> <hid/> </config>
|
|
||||||
</start> }
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<start name="timer">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Timer"/></provides>
|
|
||||||
</start>
|
|
||||||
|
|
||||||
<start name="ram_fs" priority="-1">
|
<start name="ram_fs" priority="-1">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<provides> <service name="File_system"/> </provides>
|
<provides> <service name="File_system"/> </provides>
|
||||||
<config>
|
<config>
|
||||||
<policy root="/" writeable="yes" />
|
<default-policy root="/" writeable="yes" />
|
||||||
<content>
|
<content>
|
||||||
<dir name="var"/>
|
<dir name="var"/>
|
||||||
</content>
|
</content>
|
||||||
@@ -103,21 +24,11 @@ append config {
|
|||||||
</vfs>
|
</vfs>
|
||||||
</libc>
|
</libc>
|
||||||
</config>
|
</config>
|
||||||
</start>
|
</start> }
|
||||||
</config>}
|
|
||||||
|
|
||||||
install_config $config
|
|
||||||
|
|
||||||
#
|
|
||||||
# Boot modules
|
|
||||||
#
|
|
||||||
|
|
||||||
# generic modules
|
|
||||||
set boot_modules {
|
set boot_modules {
|
||||||
core init
|
ram_fs
|
||||||
timer ram_fs
|
|
||||||
ltris
|
ltris
|
||||||
ld.lib.so
|
|
||||||
libc.lib.so
|
libc.lib.so
|
||||||
libm.lib.so
|
libm.lib.so
|
||||||
pthread.lib.so
|
pthread.lib.so
|
||||||
@@ -128,15 +39,4 @@ set boot_modules {
|
|||||||
ltris_data.tar
|
ltris_data.tar
|
||||||
}
|
}
|
||||||
|
|
||||||
# platform-specific modules
|
source ${genode_dir}/repos/world/run/framebuffer_app.inc
|
||||||
lappend_if [have_spec linux] boot_modules fb_sdl
|
|
||||||
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
||||||
lappend_if [have_spec ps2] boot_modules ps2_drv
|
|
||||||
lappend_if [have_spec usb] boot_modules usb_drv
|
|
||||||
lappend_if [have_spec platform_rpi] boot_modules platform_drv
|
|
||||||
|
|
||||||
build_boot_image $boot_modules
|
|
||||||
|
|
||||||
append qemu_args " -m 256 "
|
|
||||||
|
|
||||||
run_genode_until forever
|
|
||||||
|
|||||||
@@ -1,89 +1,13 @@
|
|||||||
#
|
set build_components { app/numptyphysics server/ram_fs }
|
||||||
# Build
|
|
||||||
#
|
|
||||||
|
|
||||||
set build_components {
|
set fb_config { <config buffered="yes" width="800" height="600"/> }
|
||||||
core init
|
|
||||||
drivers/timer
|
|
||||||
app/numptyphysics server/ram_fs
|
|
||||||
drivers/framebuffer drivers/platform drivers/input
|
|
||||||
}
|
|
||||||
|
|
||||||
lappend_if [have_spec usb] build_components drivers/usb
|
set app_config {
|
||||||
|
|
||||||
build $build_components
|
|
||||||
|
|
||||||
create_boot_directory
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate config
|
|
||||||
#
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<config prio_levels="4">
|
|
||||||
<parent-provides>
|
|
||||||
<service name="ROM"/>
|
|
||||||
<service name="RAM"/>
|
|
||||||
<service name="IRQ"/>
|
|
||||||
<service name="IO_MEM"/>
|
|
||||||
<service name="IO_PORT"/>
|
|
||||||
<service name="CAP"/>
|
|
||||||
<service name="PD"/>
|
|
||||||
<service name="RM"/>
|
|
||||||
<service name="CPU"/>
|
|
||||||
<service name="LOG"/>
|
|
||||||
<service name="SIGNAL"/>
|
|
||||||
</parent-provides>
|
|
||||||
<default-route>
|
|
||||||
<any-service> <parent/> <any-child/> </any-service>
|
|
||||||
</default-route>}
|
|
||||||
|
|
||||||
append_if [have_spec sdl] config {
|
|
||||||
<start name="fb_sdl">
|
|
||||||
<resource name="RAM" quantum="4M"/>
|
|
||||||
<provides>
|
|
||||||
<service name="Input"/>
|
|
||||||
<service name="Framebuffer"/>
|
|
||||||
</provides>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec platform_rpi] config {
|
|
||||||
<start name="platform_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Platform"/></provides>
|
|
||||||
<config/>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec framebuffer] config {
|
|
||||||
<start name="fb_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="4M"/>
|
|
||||||
<provides><service name="Framebuffer"/></provides>
|
|
||||||
<config buffered="yes" />
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec ps2] config {
|
|
||||||
<start name="ps2_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [expr ![have_spec ps2] && [have_spec usb]] config {
|
|
||||||
<start name="usb_drv">
|
|
||||||
<resource name="RAM" quantum="12M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
<config ehci="yes" uhci="yes" xhci="no"> <hid/> </config>
|
|
||||||
</start> }
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<start name="timer">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Timer"/></provides>
|
|
||||||
</start>
|
|
||||||
|
|
||||||
<start name="ram_fs" priority="-1">
|
<start name="ram_fs" priority="-1">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<provides> <service name="File_system"/> </provides>
|
<provides> <service name="File_system"/> </provides>
|
||||||
<config> <policy writeable="yes" root="/"/> </config>
|
<config> <default-policy writeable="yes" root="/"/> </config>
|
||||||
</start>
|
</start>
|
||||||
|
|
||||||
<start name="numptyphysics" priority="-2">
|
<start name="numptyphysics" priority="-2">
|
||||||
@@ -100,20 +24,11 @@ append config {
|
|||||||
</start>
|
</start>
|
||||||
</config>}
|
</config>}
|
||||||
|
|
||||||
install_config $config
|
|
||||||
|
|
||||||
#
|
|
||||||
# Boot modules
|
|
||||||
#
|
|
||||||
|
|
||||||
# generic modules
|
|
||||||
set boot_modules {
|
set boot_modules {
|
||||||
core init
|
ram_fs
|
||||||
timer ram_fs
|
|
||||||
numptyphysics
|
numptyphysics
|
||||||
freetype.lib.so
|
freetype.lib.so
|
||||||
jpeg.lib.so
|
jpeg.lib.so
|
||||||
ld.lib.so
|
|
||||||
libc.lib.so
|
libc.lib.so
|
||||||
libm.lib.so
|
libm.lib.so
|
||||||
libpng.lib.so
|
libpng.lib.so
|
||||||
@@ -126,15 +41,4 @@ set boot_modules {
|
|||||||
numptyphysics_data.tar
|
numptyphysics_data.tar
|
||||||
}
|
}
|
||||||
|
|
||||||
# platform-specific modules
|
source ${genode_dir}/repos/world/run/framebuffer_app.inc
|
||||||
lappend_if [have_spec linux] boot_modules fb_sdl
|
|
||||||
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
||||||
lappend_if [have_spec ps2] boot_modules ps2_drv
|
|
||||||
lappend_if [have_spec usb] boot_modules usb_drv
|
|
||||||
lappend_if [have_spec platform_rpi] boot_modules platform_drv
|
|
||||||
|
|
||||||
build_boot_image $boot_modules
|
|
||||||
|
|
||||||
append qemu_args " -m 256 "
|
|
||||||
|
|
||||||
run_genode_until forever
|
|
||||||
|
|||||||
108
run/supertux.run
108
run/supertux.run
@@ -1,89 +1,11 @@
|
|||||||
#
|
set build_components { app/supertux server/ram_fs }
|
||||||
# Build
|
|
||||||
#
|
|
||||||
|
|
||||||
set build_components {
|
set app_config {
|
||||||
core init
|
|
||||||
drivers/timer
|
|
||||||
app/supertux server/ram_fs
|
|
||||||
drivers/framebuffer drivers/platform drivers/input
|
|
||||||
}
|
|
||||||
|
|
||||||
lappend_if [have_spec usb] build_components drivers/usb
|
|
||||||
|
|
||||||
build $build_components
|
|
||||||
|
|
||||||
create_boot_directory
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate config
|
|
||||||
#
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<config prio_levels="4">
|
|
||||||
<parent-provides>
|
|
||||||
<service name="ROM"/>
|
|
||||||
<service name="RAM"/>
|
|
||||||
<service name="IRQ"/>
|
|
||||||
<service name="IO_MEM"/>
|
|
||||||
<service name="IO_PORT"/>
|
|
||||||
<service name="CAP"/>
|
|
||||||
<service name="PD"/>
|
|
||||||
<service name="RM"/>
|
|
||||||
<service name="CPU"/>
|
|
||||||
<service name="LOG"/>
|
|
||||||
<service name="SIGNAL"/>
|
|
||||||
</parent-provides>
|
|
||||||
<default-route>
|
|
||||||
<any-service> <parent/> <any-child/> </any-service>
|
|
||||||
</default-route>}
|
|
||||||
|
|
||||||
append_if [have_spec sdl] config {
|
|
||||||
<start name="fb_sdl">
|
|
||||||
<resource name="RAM" quantum="4M"/>
|
|
||||||
<provides>
|
|
||||||
<service name="Input"/>
|
|
||||||
<service name="Framebuffer"/>
|
|
||||||
</provides>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec platform_rpi] config {
|
|
||||||
<start name="platform_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Platform"/></provides>
|
|
||||||
<config/>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec framebuffer] config {
|
|
||||||
<start name="fb_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="6M"/>
|
|
||||||
<provides><service name="Framebuffer"/></provides>
|
|
||||||
<config buffered="yes" />
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [have_spec ps2] config {
|
|
||||||
<start name="ps2_drv" priority="-1">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
</start>}
|
|
||||||
|
|
||||||
append_if [expr ![have_spec ps2] && [have_spec usb]] config {
|
|
||||||
<start name="usb_drv">
|
|
||||||
<resource name="RAM" quantum="12M"/>
|
|
||||||
<provides><service name="Input"/></provides>
|
|
||||||
<config ehci="yes" uhci="yes" xhci="no"> <hid/> </config>
|
|
||||||
</start> }
|
|
||||||
|
|
||||||
append config {
|
|
||||||
<start name="timer">
|
|
||||||
<resource name="RAM" quantum="1M"/>
|
|
||||||
<provides><service name="Timer"/></provides>
|
|
||||||
</start>
|
|
||||||
|
|
||||||
<start name="ram_fs" priority="-1">
|
<start name="ram_fs" priority="-1">
|
||||||
<resource name="RAM" quantum="4M"/>
|
<resource name="RAM" quantum="4M"/>
|
||||||
<provides> <service name="File_system"/> </provides>
|
<provides> <service name="File_system"/> </provides>
|
||||||
<config> <policy writeable="yes" root="/"/> </config>
|
<config> <default-policy writeable="yes" root="/"/> </config>
|
||||||
</start>
|
</start>
|
||||||
|
|
||||||
<start name="supertux" priority="-2">
|
<start name="supertux" priority="-2">
|
||||||
@@ -100,19 +22,10 @@ append config {
|
|||||||
</start>
|
</start>
|
||||||
</config>}
|
</config>}
|
||||||
|
|
||||||
install_config $config
|
|
||||||
|
|
||||||
#
|
|
||||||
# Boot modules
|
|
||||||
#
|
|
||||||
|
|
||||||
# generic modules
|
|
||||||
set boot_modules {
|
set boot_modules {
|
||||||
core init
|
ram_fs
|
||||||
timer ram_fs
|
|
||||||
supertux
|
supertux
|
||||||
jpeg.lib.so
|
jpeg.lib.so
|
||||||
ld.lib.so
|
|
||||||
libc.lib.so
|
libc.lib.so
|
||||||
libm.lib.so
|
libm.lib.so
|
||||||
libpng.lib.so
|
libpng.lib.so
|
||||||
@@ -125,15 +38,4 @@ set boot_modules {
|
|||||||
supertux_data.tar
|
supertux_data.tar
|
||||||
}
|
}
|
||||||
|
|
||||||
# platform-specific modules
|
source ${genode_dir}/repos/world/run/framebuffer_app.inc
|
||||||
lappend_if [have_spec linux] boot_modules fb_sdl
|
|
||||||
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
||||||
lappend_if [have_spec ps2] boot_modules ps2_drv
|
|
||||||
lappend_if [have_spec usb] boot_modules usb_drv
|
|
||||||
lappend_if [have_spec platform_rpi] boot_modules platform_drv
|
|
||||||
|
|
||||||
build_boot_image $boot_modules
|
|
||||||
|
|
||||||
append qemu_args " -m 256 "
|
|
||||||
|
|
||||||
run_genode_until forever
|
|
||||||
|
|||||||
Reference in New Issue
Block a user