Files
genode-world/run/chocolate-doom.run
Norman Feske 670aab19e3 Adaptation to Genode 17.05
- Adjust use of exceptions to unified exception types:
  https://genode.org/documentation/release-notes/17.05#Streamlining_exception_types
- Add posix.lib.so as boot module:
  http://genode.org/documentation/release-notes/17.05#POSIX_libc_profile_as_shared_library
- Adaptation to API changes

Ref #74
2017-06-02 11:48:15 +02:00

210 lines
5.0 KiB
Plaintext

#
# Build
#
if {[have_include "power_on/qemu"]} {
puts "\nRunning on Qemu is not recommended.\n"
exit 1
}
#
# On x86 systems w/o ps2 only use usb input
#
set use_usb_input_only 0
set use_audio [expr ![have_spec arm]]
set build_components {
core init
drivers/timer
server/tar_fs
drivers/framebuffer
drivers/input
app/chocolate-doom/doom
}
if {[have_spec linux]} {
set use_usb_input_only 1
}
lappend_if $use_audio build_components drivers/audio
source ${genode_dir}/repos/base/run/platform_drv.inc
append_platform_drv_build_components
lappend_if [expr ![have_spec linux]] build_components drivers/usb
lappend_if [expr !$use_usb_input_only] build_components server/input_merger
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="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>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>}
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_platform_drv_config
append_if [have_spec vesa] config {
<start name="fb_drv">
<resource name="RAM" quantum="10M"/>
<provides><service name="Framebuffer"/></provides>
<config buffered="yes"/>
</start>}
append_if [have_spec pl11x] config {
<start name="fb_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="Framebuffer"/></provides>
</start>}
append_if [expr [have_spec ps2] && !$use_usb_input_only] config {
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append_if [expr ![have_spec linux]] config {
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides><service name="Input"/></provides>
<config uhci="yes" ehci="yes" xhci="yes">
<hid/>
</config>
</start>}
append_if $use_audio config {
<start name="audio_drv">
<resource name="RAM" quantum="8M"/>
<provides><service name="Audio_out"/></provides>
</start>}
append_if [expr !$use_usb_input_only] config {
<start name="input_merger">
<resource name="RAM" quantum="1M" />
<provides>
<service name="Input" />
</provides>
<config>
<input label="ps2" />
<input label="usb_hid" />
</config>
<route>
<service name="Input" label="ps2"> <child name="ps2_drv" /> </service>
<service name="Input" label="usb_hid"> <child name="usb_drv" /> </service>
<any-service> <parent /> <any-child /> </any-service>
</route>
</start>}
append config {
<start name="tar_fs">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<archive name="data.tar" />
<policy label_prefix="chocolate-doom -> wads" root="/wads" />
</config>
</start>
<start name="chocolate-doom">
<resource name="RAM" quantum="16M"/>
<config>
<sdl_audio_volume value="100"/>
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<dir name="dev"> <log/> </dir>
<fs label="wads"/>
</vfs>
</libc>
</config>
<route>}
append_if [expr !$use_usb_input_only] config {
<service name="Input"><child name="input_merger" /></service>}
append config {
<any-service> <parent /> <any-child /></any-service>
</route>
</start>
</config>}
install_config $config
if {![file exists bin/data.tar]} {
if {![file exists bin/doom1.wad]} {
puts ""
puts "Please download the Doom 1 Shareware IWAD from"
puts " http://distro.ibiblio.org/pub/linux/distributions/slitaz/sources/packages/d/doom1.wad"
puts "and place it in './bin'. Afterwards run this script again."
puts ""
exit 1
}
catch { exec mkdir bin/wads }
catch { exec cp bin/doom1.wad bin/wads }
exec tar cf bin/data.tar -C bin wads
}
#
# Boot modules
#
# generic modules
set boot_modules {
core init timer tar_fs
chocolate-doom
ld.lib.so
libc.lib.so posix.lib.so libm.lib.so sdl.lib.so sdl_net.lib.so
sdl_mixer.lib.so pthread.lib.so
data.tar
}
# platform-specific modules
append_platform_drv_boot_modules
lappend_if $use_audio boot_modules audio_drv
lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec vesa] boot_modules fb_drv
lappend_if [expr ![have_spec linux]] boot_modules usb_drv
lappend_if [expr !$use_usb_input_only] boot_modules input_merger
lappend_if [expr [have_spec ps2] && !$use_usb_input_only] boot_modules ps2_drv
lappend_if [have_spec pl11x] boot_modules fb_drv
build_boot_image $boot_modules
run_genode_until forever