2014-07-02 15:35:56 +00:00
|
|
|
set use_net 0
|
2015-02-22 18:04:55 +00:00
|
|
|
set use_ps2 [have_spec ps2]
|
|
|
|
set use_usb 0
|
2017-01-31 14:13:58 +00:00
|
|
|
set use_serial 1
|
2014-07-02 15:35:56 +00:00
|
|
|
|
2017-01-31 14:13:58 +00:00
|
|
|
set use_vbox4 1
|
|
|
|
set use_vbox5 [expr !$use_vbox4]
|
2017-01-10 14:30:02 +00:00
|
|
|
|
2017-04-20 18:42:10 +00:00
|
|
|
set use_gui 0
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
set build_components {
|
2017-01-31 14:13:58 +00:00
|
|
|
core init
|
2013-08-21 09:37:21 +00:00
|
|
|
drivers/framebuffer
|
|
|
|
drivers/timer
|
|
|
|
}
|
|
|
|
|
2017-01-31 14:13:58 +00:00
|
|
|
if {$use_vbox4} {
|
|
|
|
append build_components virtualbox
|
|
|
|
set virtualbox_binary "virtualbox-rem"
|
|
|
|
if {[have_spec muen]} { set virtualbox_binary "virtualbox-muen" }
|
|
|
|
if {[have_spec nova]} { set virtualbox_binary "virtualbox-nova" }
|
|
|
|
} else {
|
|
|
|
append build_components virtualbox5
|
|
|
|
set virtualbox_binary "virtualbox5-rem"
|
|
|
|
if {[have_spec nova]} { set virtualbox_binary "virtualbox5-nova" }
|
|
|
|
}
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
# override defaults of platform_drv.inc
|
|
|
|
proc platform_drv_priority {} { return { priority="-1"} }
|
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
lappend_if [expr $use_ps2] build_components drivers/input
|
|
|
|
lappend_if [expr $use_usb] build_components drivers/usb
|
2014-11-28 16:14:54 +00:00
|
|
|
lappend_if [expr $use_serial] build_components server/log_terminal
|
|
|
|
lappend_if [have_spec x86] build_components drivers/rtc
|
2013-08-21 09:37:21 +00:00
|
|
|
|
2014-11-28 16:14:54 +00:00
|
|
|
lappend_if [expr $use_net] build_components drivers/nic
|
2014-07-02 15:35:56 +00:00
|
|
|
|
2017-04-20 18:42:10 +00:00
|
|
|
lappend_if [expr $use_gui] build_components server/report_rom
|
|
|
|
lappend_if [expr $use_gui] build_components server/nitpicker
|
|
|
|
lappend_if [expr $use_gui] build_components server/nit_fb
|
|
|
|
lappend_if [expr $use_gui] build_components app/vbox_pointer
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
set config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<config prio_levels="4">
|
2013-08-21 09:37:21 +00:00
|
|
|
<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"/>
|
2015-06-08 22:45:34 +00:00
|
|
|
<service name="LOG"/>}
|
|
|
|
|
|
|
|
append_if [have_spec muen] config {
|
|
|
|
<service name="VM"/>}
|
|
|
|
|
|
|
|
append config {
|
2013-08-21 09:37:21 +00:00
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
2015-05-28 11:43:13 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2013-08-21 09:37:21 +00:00
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2013-08-21 09:37:21 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_config
|
2013-08-21 09:37:21 +00:00
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
append_if [expr $use_ps2] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="ps2_drv" priority="-1">
|
2013-08-21 09:37:21 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
2014-05-23 07:26:57 +00:00
|
|
|
</start>}
|
2013-08-21 09:37:21 +00:00
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
append_if [expr $use_usb] config {
|
|
|
|
<start name="usb_drv" priority="-1">
|
|
|
|
<resource name="RAM" quantum="7M"/>
|
2015-06-08 22:45:34 +00:00
|
|
|
<provides><service name="Input"/></provides>}
|
|
|
|
|
2017-01-03 12:17:41 +00:00
|
|
|
append_if [expr $use_usb && ![have_spec muen]] config {
|
2015-06-08 22:45:34 +00:00
|
|
|
<config uhci="yes" ehci="yes" xhci="yes">}
|
|
|
|
|
2017-01-03 12:17:41 +00:00
|
|
|
append_if [expr $use_usb && [have_spec muen]] config {
|
2015-06-08 22:45:34 +00:00
|
|
|
<config uhci="no" ehci="no" xhci="yes">}
|
|
|
|
|
|
|
|
append_if [expr $use_usb] config {
|
2015-02-22 18:04:55 +00:00
|
|
|
<hid/>
|
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
append_if [have_spec framebuffer] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="fb_drv" priority="-1">
|
2013-08-21 09:37:21 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Framebuffer"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
append_if [have_spec sdl] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="fb_sdl" priority="-1">
|
2013-08-21 09:37:21 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Input"/>
|
|
|
|
<service name="Framebuffer"/>
|
|
|
|
</provides>
|
|
|
|
</start>}
|
|
|
|
|
2014-05-23 07:26:57 +00:00
|
|
|
append_if [have_spec x86] config {
|
2014-07-02 10:11:20 +00:00
|
|
|
<start name="rtc_drv" priority="-1">
|
2014-05-23 07:26:57 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Rtc"/>
|
|
|
|
</provides>
|
|
|
|
</start>}
|
|
|
|
|
2014-07-02 15:35:56 +00:00
|
|
|
append_if [expr $use_net] config {
|
|
|
|
<start name="nic_drv" priority="-1">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
</start>
|
|
|
|
}
|
|
|
|
|
2014-11-28 16:14:54 +00:00
|
|
|
append_if [expr $use_serial] config {
|
2017-04-20 18:42:10 +00:00
|
|
|
<start name="log_terminal" priority="-1">
|
2014-11-28 16:14:54 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Terminal"/>
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
}
|
|
|
|
|
2017-04-20 18:42:10 +00:00
|
|
|
append_if [expr $use_gui] config {
|
|
|
|
<start name="report_rom" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config>
|
|
|
|
<policy label="vbox_pointer -> hover" report="nitpicker -> hover"/>
|
|
|
|
<policy label="vbox_pointer -> xray" report="nitpicker -> xray"/>
|
|
|
|
<policy label="vbox_pointer -> shape1" report="vbox1 -> shape"/>
|
|
|
|
<policy label="vbox_pointer -> shape2" report="vbox2 -> shape"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nitpicker" priority="-1">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Nitpicker"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="Framebuffer"> <child name="fb_drv" /> </service>
|
|
|
|
<service name="Report"> <child name="report_rom" /> </service>}
|
|
|
|
|
|
|
|
append_if [expr ($use_gui && $use_ps2)] config {
|
|
|
|
<service name="Input"> <child name="ps2_drv"/> </service>}
|
|
|
|
append_if [expr ($use_gui && $use_usb)] config {
|
|
|
|
<service name="Input"> <child name="usb_drv"/> </service>}
|
|
|
|
|
|
|
|
append_if [expr $use_gui] config {
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
<config>
|
|
|
|
<report focus="yes" hover="yes" xray="yes" />
|
|
|
|
|
|
|
|
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
|
|
|
|
<domain name="" layer="2" content="client" focus="click" hover="always" />
|
|
|
|
|
|
|
|
<policy label_prefix="vbox_pointer" domain="pointer"/>
|
|
|
|
<default-policy domain=""/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="vbox_pointer" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<config>
|
|
|
|
<policy label="nit_fb1" rom="shape1"/>
|
|
|
|
<policy label="nit_fb2" rom="shape2"/>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
|
|
|
<service name="ROM" label="shape1"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="shape2"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="hover"> <child name="report_rom"/> </service>
|
|
|
|
<service name="ROM" label="xray"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nit_fb1" priority="-1">
|
|
|
|
<binary name="nit_fb"/>
|
|
|
|
<resource name="RAM" quantum="8M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Framebuffer" />
|
|
|
|
<service name="Input" />
|
|
|
|
</provides>
|
|
|
|
|
|
|
|
<config xpos="10" ypos="10" width="800" height="600"/>
|
|
|
|
|
|
|
|
<route>
|
|
|
|
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nit_fb2" priority="-1">
|
|
|
|
<binary name="nit_fb"/>
|
|
|
|
<resource name="RAM" quantum="8M" />
|
|
|
|
<provides>
|
|
|
|
<service name="Framebuffer" />
|
|
|
|
<service name="Input" />
|
|
|
|
</provides>
|
|
|
|
<config xpos="410" ypos="310" width="800" height="600"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="vbox2" priority="-2" caps="200">}
|
2017-04-20 18:42:10 +00:00
|
|
|
append_if [expr $use_gui] config "
|
|
|
|
<binary name=\"$virtualbox_binary\"/>"
|
|
|
|
append_if [expr $use_gui] config {
|
|
|
|
<resource name="RAM" quantum="448M"/>
|
|
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <rtc/> </dir>
|
|
|
|
<rom name="test.vbox" />
|
|
|
|
<rom name="test.iso" />
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Framebuffer"> <child name="nit_fb2" /> </service>
|
|
|
|
<service name="Input"> <child name="nit_fb2" /> </service>
|
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
append config {
|
2017-05-07 20:36:11 +00:00
|
|
|
<start name="vbox1" priority="-2" caps="200">}
|
2017-01-10 14:30:02 +00:00
|
|
|
append config "
|
|
|
|
<binary name=\"$virtualbox_binary\"/>"
|
|
|
|
append config {
|
2014-09-23 11:01:47 +00:00
|
|
|
<resource name="RAM" quantum="448M"/>
|
|
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
2017-01-05 12:45:37 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> <rtc/> </dir>}
|
2014-11-28 16:14:54 +00:00
|
|
|
|
|
|
|
append_if [expr $use_serial] config {
|
2017-01-05 12:45:37 +00:00
|
|
|
<dir name="dev"> <terminal/> </dir>}
|
2014-11-28 16:14:54 +00:00
|
|
|
|
|
|
|
append config {
|
2017-01-05 12:45:37 +00:00
|
|
|
<rom name="test.vbox" />
|
|
|
|
<rom name="test.iso" />
|
|
|
|
</vfs>
|
2013-08-21 09:37:21 +00:00
|
|
|
</config>
|
2017-04-20 18:42:10 +00:00
|
|
|
<route>}
|
|
|
|
|
|
|
|
append_if [expr $use_gui] config {
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="Framebuffer"> <child name="nit_fb1" /> </service>
|
|
|
|
<service name="Input"> <child name="nit_fb1" /> </service>}
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
2013-08-21 09:37:21 +00:00
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
exec cp ${genode_dir}/repos/ports/run/test.vbox bin/.
|
|
|
|
|
2017-01-10 14:30:02 +00:00
|
|
|
set boot_modules { core ld.lib.so init timer test.iso test.vbox }
|
|
|
|
|
|
|
|
append boot_modules $virtualbox_binary
|
2013-08-21 09:37:21 +00:00
|
|
|
|
|
|
|
# platform-specific modules
|
2015-02-22 18:04:55 +00:00
|
|
|
lappend_if [expr $use_usb] boot_modules usb_drv
|
|
|
|
lappend_if [expr $use_ps2] boot_modules ps2_drv
|
2013-08-21 09:37:21 +00:00
|
|
|
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
|
|
|
lappend_if [have_spec linux] boot_modules fb_sdl
|
2014-05-23 07:26:57 +00:00
|
|
|
lappend_if [have_spec x86] boot_modules rtc_drv
|
|
|
|
|
2017-04-20 18:42:10 +00:00
|
|
|
lappend_if [expr $use_gui] boot_modules report_rom
|
|
|
|
lappend_if [expr $use_gui] boot_modules nitpicker
|
|
|
|
lappend_if [expr $use_gui] boot_modules nit_fb
|
|
|
|
lappend_if [expr $use_gui] boot_modules vbox_pointer
|
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
append boot_modules {
|
2016-03-06 14:21:23 +00:00
|
|
|
ld.lib.so libc.lib.so libm.lib.so pthread.lib.so libc_pipe.lib.so
|
2014-09-23 11:01:47 +00:00
|
|
|
libc_terminal.lib.so libiconv.lib.so stdcxx.lib.so
|
2016-01-23 13:42:55 +00:00
|
|
|
qemu-usb.lib.so
|
2014-09-23 11:01:47 +00:00
|
|
|
}
|
2013-08-21 09:37:21 +00:00
|
|
|
|
2014-11-28 16:14:54 +00:00
|
|
|
append_if [expr $use_net] boot_modules { nic_drv }
|
|
|
|
append_if [expr $use_serial] boot_modules { log_terminal }
|
2014-07-02 15:35:56 +00:00
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
if {[have_include "power_on/qemu"]} {
|
2017-04-20 18:42:10 +00:00
|
|
|
if {[expr $use_gui]} {
|
|
|
|
append qemu_args " -m 2048 "
|
|
|
|
} else {
|
|
|
|
append qemu_args " -m 768 "
|
|
|
|
}
|
|
|
|
|
2015-02-22 18:04:55 +00:00
|
|
|
append qemu_args " -cpu phenom "
|
|
|
|
if {[expr $use_usb]} {
|
|
|
|
append qemu_args " -usbdevice mouse -usbdevice keyboard"
|
|
|
|
}
|
|
|
|
}
|
2013-08-21 09:37:21 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|