2014-07-02 15:35:56 +00:00
|
|
|
set use_net 0
|
2021-01-13 09:15:10 +00:00
|
|
|
set use_ps2 1
|
2015-02-22 18:04:55 +00:00
|
|
|
set use_usb 0
|
2017-01-31 14:13:58 +00:00
|
|
|
set use_serial 1
|
2019-05-06 08:34:47 +00:00
|
|
|
set use_top 1
|
2014-07-02 15:35:56 +00:00
|
|
|
|
2019-05-06 08:34:47 +00:00
|
|
|
set use_vbox5_nova 0
|
2017-01-10 14:30:02 +00:00
|
|
|
|
2017-06-19 07:05:39 +00:00
|
|
|
# use_gui starts two VMs
|
2017-04-20 18:42:10 +00:00
|
|
|
set use_gui 0
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
set build_components {
|
|
|
|
drivers/framebuffer
|
2019-03-04 12:53:40 +00:00
|
|
|
server/report_rom
|
2013-08-21 09:37:21 +00:00
|
|
|
}
|
|
|
|
|
2019-05-06 08:34:47 +00:00
|
|
|
append build_components virtualbox5
|
|
|
|
|
|
|
|
set virtualbox_binary "virtualbox5"
|
|
|
|
|
|
|
|
if {$use_vbox5_nova} {
|
|
|
|
set virtualbox_binary "virtualbox5-nova"
|
2017-01-31 14:13:58 +00:00
|
|
|
}
|
|
|
|
|
2019-03-04 12:53:40 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/src/init \
|
2020-07-23 13:14:54 +00:00
|
|
|
[depot_user]/src/nitpicker \
|
|
|
|
[depot_user]/src/vfs_pipe
|
2019-03-04 12:53:40 +00:00
|
|
|
|
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"} }
|
|
|
|
|
2019-05-06 08:34:47 +00:00
|
|
|
lappend_if [expr $use_top] build_components app/top
|
2020-08-14 10:03:09 +00:00
|
|
|
lappend_if [expr $use_ps2] build_components drivers/ps2
|
2015-02-22 18:04:55 +00:00
|
|
|
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
|
2021-01-08 16:27:24 +00:00
|
|
|
lappend_if [expr $use_net] build_components server/nic_router
|
2014-07-02 15:35:56 +00:00
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
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="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
2019-05-06 08:34:47 +00:00
|
|
|
<service name="LOG"/>
|
2015-06-08 22:45:34 +00:00
|
|
|
<service name="VM"/>}
|
|
|
|
|
2019-05-06 08:34:47 +00:00
|
|
|
append_if [expr $use_top] config {
|
|
|
|
<service name="TRACE"/>}
|
|
|
|
|
2015-06-08 22:45:34 +00:00
|
|
|
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>}
|
|
|
|
|
2019-05-06 08:34:47 +00:00
|
|
|
append_if [expr $use_top] config {
|
|
|
|
<start name="top">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<config period_ms="15000"/>
|
|
|
|
</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">
|
2019-05-06 08:34:47 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2020-08-13 11:39:09 +00:00
|
|
|
<config/>
|
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 {
|
2017-08-25 13:36:24 +00:00
|
|
|
<start name="usb_drv" priority="-1" caps="120">
|
2020-08-13 14:03:59 +00:00
|
|
|
<resource name="RAM" quantum="12M"/>}
|
2015-06-08 22:45:34 +00:00
|
|
|
|
|
|
|
append_if [expr $use_usb] config {
|
2019-05-06 08:34:47 +00:00
|
|
|
<config uhci="yes" ehci="yes" xhci="yes">
|
2015-02-22 18:04:55 +00:00
|
|
|
<hid/>
|
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [have_board pc] config {
|
2017-07-06 11:51:57 +00:00
|
|
|
<start name="fb_drv" priority="-1" caps="150">
|
2019-05-03 11:51:49 +00:00
|
|
|
<binary name="vesa_fb_drv"/>
|
2020-07-23 13:14:54 +00:00
|
|
|
<resource name="RAM" quantum="12M"/>}
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [expr [have_board pc] && [have_include power_on/qemu]] config {
|
2020-06-16 13:46:59 +00:00
|
|
|
<config width="1280" height="1024" buffered="yes"/>}
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [have_board pc] config {
|
2013-08-21 09:37:21 +00:00
|
|
|
</start>}
|
|
|
|
|
2021-01-13 09:15:10 +00:00
|
|
|
append_if [have_board linux] config {
|
2018-07-04 16:48:04 +00:00
|
|
|
<start name="fb_sdl" priority="-1" ld="no">
|
2013-08-21 09:37:21 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
</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">
|
2019-04-24 13:09:49 +00:00
|
|
|
<binary name="ipxe_nic_drv"/>
|
2021-01-08 16:27:24 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config mode="uplink_client"/>
|
|
|
|
<route>
|
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
2014-07-02 15:35:56 +00:00
|
|
|
</start>
|
2021-01-08 16:27:24 +00:00
|
|
|
|
|
|
|
<start name="nic_router" caps="120">
|
|
|
|
<resource name="RAM" quantum="5M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose_domain_state="yes">
|
|
|
|
|
|
|
|
<policy label_prefix="vbox" domain="downlink"/>
|
|
|
|
<policy label_prefix="nic_drv" domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink">
|
|
|
|
|
|
|
|
<nat domain="downlink"
|
|
|
|
tcp-ports="16384"
|
|
|
|
udp-ports="16384"
|
|
|
|
icmp-ids="16384"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24" verbose_packets="no">
|
|
|
|
|
|
|
|
<dhcp-server ip_first="10.0.3.100" ip_last="10.0.3.200">
|
|
|
|
<dns-server ip="8.8.8.8"/>
|
|
|
|
<dns-server ip="1.1.1.1"/>
|
|
|
|
</dhcp-server>
|
|
|
|
|
|
|
|
<tcp dst="0.0.0.0/0"><permit-any domain="uplink" /></tcp>
|
|
|
|
<udp dst="0.0.0.0/0"><permit-any domain="uplink" /></udp>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink"/>
|
|
|
|
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
</start> }
|
2014-07-02 15:35:56 +00:00
|
|
|
|
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>
|
|
|
|
}
|
|
|
|
|
2019-03-04 12:53:40 +00:00
|
|
|
append config {
|
2017-04-20 18:42:10 +00:00
|
|
|
<start name="report_rom" priority="-1">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config>
|
2017-11-24 17:56:25 +00:00
|
|
|
<policy label="pointer -> hover" report="nitpicker -> hover"/>
|
|
|
|
<policy label="pointer -> xray" report="nitpicker -> xray"/>
|
2017-04-20 18:42:10 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nitpicker" priority="-1">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
2020-08-13 11:39:09 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Gui"/> <service name="Capture"/> <service name="Event"/>
|
|
|
|
</provides>
|
2017-04-20 18:42:10 +00:00
|
|
|
<route>
|
|
|
|
<service name="Report"> <child name="report_rom" /> </service>}
|
|
|
|
|
2019-03-04 12:53:40 +00:00
|
|
|
append config {
|
2017-04-20 18:42:10 +00:00
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
2020-08-13 15:25:21 +00:00
|
|
|
<config>
|
2020-08-13 11:39:09 +00:00
|
|
|
<capture/> <event/>
|
2020-07-01 20:26:11 +00:00
|
|
|
|
2017-04-20 18:42:10 +00:00
|
|
|
<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" />
|
|
|
|
|
2017-11-24 17:56:25 +00:00
|
|
|
<policy label_prefix="pointer" domain="pointer"/>
|
2017-04-20 18:42:10 +00:00
|
|
|
<default-policy domain=""/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2017-11-24 17:56:25 +00:00
|
|
|
<start name="pointer" priority="-1">
|
2017-04-20 18:42:10 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2019-03-04 12:53:40 +00:00
|
|
|
<provides><service name="Report"/></provides>
|
2017-11-24 18:53:30 +00:00
|
|
|
<config shapes="yes"/>
|
2017-04-20 18:42:10 +00:00
|
|
|
<route>
|
2020-06-11 14:06:21 +00:00
|
|
|
<service name="Gui"> <child name="nitpicker"/> </service>
|
2017-04-20 18:42:10 +00:00
|
|
|
<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>
|
2019-03-04 12:53:40 +00:00
|
|
|
</start>}
|
2017-04-20 18:42:10 +00:00
|
|
|
|
2019-03-04 12:53:40 +00:00
|
|
|
append_if [expr $use_gui] config {
|
2019-05-06 08:34:47 +00:00
|
|
|
<start name="vbox2" priority="-2" caps="800">
|
|
|
|
<binary name="} $virtualbox_binary {"/>
|
2017-04-20 18:42:10 +00:00
|
|
|
<resource name="RAM" quantum="448M"/>
|
|
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
2020-07-23 13:14:54 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
2017-04-20 18:42:10 +00:00
|
|
|
<vfs>
|
2020-07-23 13:14:54 +00:00
|
|
|
<dir name="dev">
|
|
|
|
<log/> <rtc/>
|
|
|
|
</dir>
|
|
|
|
<dir name="pipe"> <pipe/> </dir>
|
2017-04-20 18:42:10 +00:00
|
|
|
<rom name="test.vbox" />
|
|
|
|
<rom name="test.iso" />
|
|
|
|
</vfs>
|
|
|
|
</config>
|
|
|
|
<route>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2020-06-16 11:48:09 +00:00
|
|
|
<service name="Report" label="shape"> <child name="pointer" label="gui_fb2 -> shape"/> </service>
|
2017-04-20 18:42:10 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
2013-08-21 09:37:21 +00:00
|
|
|
append config {
|
2019-05-06 08:34:47 +00:00
|
|
|
<start name="vbox1" priority="-2" caps="800">
|
|
|
|
<binary name="} $virtualbox_binary {"/>
|
2014-09-23 11:01:47 +00:00
|
|
|
<resource name="RAM" quantum="448M"/>
|
|
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
2020-07-23 13:14:54 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
2017-01-05 12:45:37 +00:00
|
|
|
<vfs>
|
2020-07-23 13:14:54 +00:00
|
|
|
<dir name="dev">
|
|
|
|
<log/> <rtc/>
|
|
|
|
</dir>
|
|
|
|
<dir name="pipe"> <pipe/> </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>
|
2021-01-08 16:27:24 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
2020-06-16 11:48:09 +00:00
|
|
|
<service name="Report" label="shape"> <child name="pointer" label="gui_fb1 -> shape"/> </service>
|
2017-04-20 18:42:10 +00:00
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<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/.
|
|
|
|
|
2019-03-04 12:53:40 +00:00
|
|
|
set boot_modules { test.iso test.vbox }
|
2017-01-10 14:30:02 +00:00
|
|
|
|
|
|
|
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
|
2021-01-13 09:15:10 +00:00
|
|
|
lappend_if [have_board pc] boot_modules vesa_fb_drv
|
|
|
|
lappend_if [have_board linux] boot_modules fb_sdl
|
2014-05-23 07:26:57 +00:00
|
|
|
lappend_if [have_spec x86] boot_modules rtc_drv
|
2019-05-06 08:34:47 +00:00
|
|
|
lappend_if [expr $use_top] boot_modules top
|
2017-04-20 18:42:10 +00:00
|
|
|
lappend_if [expr $use_gui] boot_modules report_rom
|
|
|
|
|
2014-09-23 11:01:47 +00:00
|
|
|
append boot_modules {
|
2020-07-23 13:14:54 +00:00
|
|
|
libc.lib.so vfs.lib.so libm.lib.so
|
2019-05-24 15:24:36 +00:00
|
|
|
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
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
append_if [expr $use_net] boot_modules { ipxe_nic_drv }
|
2021-01-08 16:27:24 +00:00
|
|
|
append_if [expr $use_net] boot_modules { nic_router }
|
2014-11-28 16:14:54 +00:00
|
|
|
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
|