197 lines
4.7 KiB
Plaintext
197 lines
4.7 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
|
|
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>
|
|
<default caps="100"/>
|
|
|
|
<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">
|
|
<binary name="} [audio_drv_binary] {"/>
|
|
<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="chocolate-doom" caps="300">
|
|
<resource name="RAM" quantum="32M"/>
|
|
<config>
|
|
<sdl_audio_volume value="100"/>
|
|
<libc stdout="/dev/log" stderr="/dev/log">
|
|
<vfs>
|
|
<dir name="dev"> <log/> </dir>
|
|
<rom name="doom1.wad"/>
|
|
</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
|
|
}
|
|
}
|
|
|
|
#
|
|
# Boot modules
|
|
#
|
|
|
|
# generic modules
|
|
append boot_modules {
|
|
core init timer } [audio_drv_binary] {
|
|
ld.lib.so libc.lib.so libm.lib.so pthread.lib.so
|
|
sdl.lib.so sdl_net.lib.so sdl_mixer.lib.so
|
|
chocolate-doom doom1.wad
|
|
}
|
|
|
|
# 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
|