mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 15:02:25 +00:00
312 lines
8.7 KiB
Plaintext
312 lines
8.7 KiB
Plaintext
set use_net 0
|
|
set use_ps2 [have_spec ps2]
|
|
set use_usb 0
|
|
set use_serial 1
|
|
set use_top 1
|
|
|
|
set use_vbox5_nova 0
|
|
|
|
# use_gui starts two VMs
|
|
set use_gui 0
|
|
# need a nic bridge for 2 VMs
|
|
set use_bridge [expr $use_net && $use_gui]
|
|
|
|
set build_components {
|
|
drivers/framebuffer
|
|
server/report_rom
|
|
}
|
|
|
|
append build_components virtualbox5
|
|
|
|
set virtualbox_binary "virtualbox5"
|
|
|
|
if {$use_vbox5_nova} {
|
|
set virtualbox_binary "virtualbox5-nova"
|
|
}
|
|
|
|
create_boot_directory
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
[depot_user]/src/init \
|
|
[depot_user]/src/nitpicker \
|
|
[depot_user]/src/vfs_pipe
|
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
# override defaults of platform_drv.inc
|
|
proc platform_drv_priority {} { return { priority="-1"} }
|
|
|
|
lappend_if [expr $use_top] build_components app/top
|
|
lappend_if [expr $use_ps2] build_components drivers/input
|
|
lappend_if [expr $use_usb] build_components drivers/usb
|
|
lappend_if [expr $use_serial] build_components server/log_terminal
|
|
lappend_if [have_spec x86] build_components drivers/rtc
|
|
|
|
lappend_if [expr $use_net] build_components drivers/nic
|
|
lappend_if [expr $use_bridge] build_components server/nic_bridge
|
|
|
|
append_platform_drv_build_components
|
|
|
|
build $build_components
|
|
|
|
set config {
|
|
<config prio_levels="4">
|
|
<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"/>
|
|
<service name="LOG"/>
|
|
<service name="VM"/>}
|
|
|
|
append_if [expr $use_top] config {
|
|
<service name="TRACE"/>}
|
|
|
|
append config {
|
|
</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 [expr $use_top] config {
|
|
<start name="top">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<config period_ms="15000"/>
|
|
</start>}
|
|
|
|
append_platform_drv_config
|
|
|
|
append_if [expr $use_ps2] config {
|
|
<start name="ps2_drv" priority="-1">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides><service name="Input"/></provides>
|
|
</start>}
|
|
|
|
append_if [expr $use_usb] config {
|
|
<start name="usb_drv" priority="-1" caps="120">
|
|
<resource name="RAM" quantum="12M"/>
|
|
<provides><service name="Input"/></provides>}
|
|
|
|
append_if [expr $use_usb] config {
|
|
<config uhci="yes" ehci="yes" xhci="yes">
|
|
<hid/>
|
|
</config>
|
|
</start>}
|
|
|
|
append_if [have_spec framebuffer] config {
|
|
<start name="fb_drv" priority="-1" caps="150">
|
|
<binary name="vesa_fb_drv"/>
|
|
<resource name="RAM" quantum="12M"/>}
|
|
append_if [expr [have_spec framebuffer] && [have_include power_on/qemu]] config {
|
|
<config width="1280" height="1024" buffered="yes"/>}
|
|
append_if [expr [have_spec framebuffer] && [have_include power_on/qemu]] config {
|
|
<config buffered="yes"/>}
|
|
append_if [have_spec framebuffer] config {
|
|
</start>}
|
|
|
|
append_if [have_spec sdl] config {
|
|
<start name="fb_sdl" priority="-1" ld="no">
|
|
<resource name="RAM" quantum="4M"/>
|
|
<provides> <service name="Input"/> </provides>
|
|
</start>}
|
|
|
|
append_if [have_spec x86] config {
|
|
<start name="rtc_drv" priority="-1">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides>
|
|
<service name="Rtc"/>
|
|
</provides>
|
|
</start>}
|
|
|
|
append_if [expr $use_net] config {
|
|
<start name="nic_drv" priority="-1">
|
|
<binary name="ipxe_nic_drv"/>
|
|
<resource name="RAM" quantum="4M"/>
|
|
<provides><service name="Nic"/></provides>
|
|
</start>
|
|
}
|
|
|
|
append_if [expr $use_serial] config {
|
|
<start name="log_terminal" priority="-1">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides>
|
|
<service name="Terminal"/>
|
|
</provides>
|
|
</start>
|
|
}
|
|
|
|
append_if [expr $use_bridge] config {
|
|
<start name="nic_bridge" priority="-1">
|
|
<resource name="RAM" quantum="6M"/>
|
|
<provides><service name="Nic"/></provides>
|
|
<config> <default-policy/> </config>
|
|
<route>
|
|
<service name="Nic"><child name="nic_drv"/></service>
|
|
<any-service><parent/></any-service>
|
|
</route>
|
|
</start>
|
|
}
|
|
|
|
append config {
|
|
<start name="report_rom" priority="-1">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
<config>
|
|
<policy label="pointer -> hover" report="nitpicker -> hover"/>
|
|
<policy label="pointer -> xray" report="nitpicker -> xray"/>
|
|
</config>
|
|
</start>
|
|
|
|
<start name="nitpicker" priority="-1">
|
|
<resource name="RAM" quantum="4M"/>
|
|
<provides> <service name="Gui"/> <service name="Capture"/> </provides>
|
|
<route>
|
|
<service name="Report"> <child name="report_rom" /> </service>}
|
|
|
|
append_if [expr $use_ps2] config {
|
|
<service name="Input"> <child name="ps2_drv"/> </service>}
|
|
append_if [expr $use_usb] config {
|
|
<service name="Input"> <child name="usb_drv"/> </service>}
|
|
|
|
append config {
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
</route>
|
|
<config request_framebuffer="no">
|
|
<capture/>
|
|
|
|
<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="pointer" domain="pointer"/>
|
|
<default-policy domain=""/>
|
|
</config>
|
|
</start>
|
|
|
|
<start name="pointer" priority="-1">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides><service name="Report"/></provides>
|
|
<config shapes="yes"/>
|
|
<route>
|
|
<service name="Gui"> <child name="nitpicker"/> </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>}
|
|
|
|
append_if [expr $use_gui] config {
|
|
<start name="vbox2" priority="-2" caps="800">
|
|
<binary name="} $virtualbox_binary {"/>
|
|
<resource name="RAM" quantum="448M"/>
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
|
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
|
<vfs>
|
|
<dir name="dev">
|
|
<log/> <rtc/>
|
|
</dir>
|
|
<dir name="pipe"> <pipe/> </dir>
|
|
<rom name="test.vbox" />
|
|
<rom name="test.iso" />
|
|
</vfs>
|
|
</config>
|
|
<route>
|
|
<service name="Nic"> <child name="nic_bridge"/> </service>
|
|
<service name="Report" label="shape"> <child name="pointer" label="gui_fb2 -> shape"/> </service>
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
<service name="Framebuffer"> <child name="gui_fb2" /> </service>
|
|
<service name="Input"> <child name="gui_fb2" /> </service>
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
</route>
|
|
</start>}
|
|
|
|
append config {
|
|
<start name="vbox1" priority="-2" caps="800">
|
|
<binary name="} $virtualbox_binary {"/>
|
|
<resource name="RAM" quantum="448M"/>
|
|
<config vbox_file="test.vbox" vm_name="TestVM">
|
|
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
|
<vfs>
|
|
<dir name="dev">
|
|
<log/> <rtc/>
|
|
</dir>
|
|
<dir name="pipe"> <pipe/> </dir>}
|
|
|
|
append_if [expr $use_serial] config {
|
|
<dir name="dev"> <terminal/> </dir>}
|
|
|
|
append config {
|
|
<rom name="test.vbox" />
|
|
<rom name="test.iso" />
|
|
</vfs>
|
|
</config>
|
|
<route>}
|
|
|
|
append_if [expr $use_bridge] config {
|
|
<service name="Nic"> <child name="nic_bridge"/> </service>}
|
|
|
|
append config {
|
|
<service name="Report" label="shape"> <child name="pointer" label="gui_fb1 -> shape"/> </service>
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
<service name="Framebuffer"> <child name="gui_fb1" /> </service>
|
|
<service name="Input"> <child name="gui_fb1" /> </service>
|
|
<any-service> <parent /> <any-child /> </any-service>
|
|
</route>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
install_config $config
|
|
|
|
exec cp ${genode_dir}/repos/ports/run/test.vbox bin/.
|
|
|
|
set boot_modules { test.iso test.vbox }
|
|
|
|
append boot_modules $virtualbox_binary
|
|
|
|
# platform-specific modules
|
|
lappend_if [expr $use_usb] boot_modules usb_drv
|
|
lappend_if [expr $use_ps2] boot_modules ps2_drv
|
|
lappend_if [have_spec framebuffer] boot_modules vesa_fb_drv
|
|
lappend_if [have_spec linux] boot_modules fb_sdl
|
|
lappend_if [have_spec x86] boot_modules rtc_drv
|
|
lappend_if [expr $use_top] boot_modules top
|
|
lappend_if [expr $use_gui] boot_modules report_rom
|
|
|
|
append boot_modules {
|
|
libc.lib.so vfs.lib.so libm.lib.so
|
|
libiconv.lib.so stdcxx.lib.so
|
|
qemu-usb.lib.so
|
|
}
|
|
|
|
append_if [expr $use_net] boot_modules { ipxe_nic_drv }
|
|
append_if [expr $use_bridge] boot_modules { nic_bridge }
|
|
append_if [expr $use_serial] boot_modules { log_terminal }
|
|
|
|
append_platform_drv_boot_modules
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
if {[have_include "power_on/qemu"]} {
|
|
if {[expr $use_gui]} {
|
|
append qemu_args " -m 2048 "
|
|
} else {
|
|
append qemu_args " -m 768 "
|
|
}
|
|
|
|
append qemu_args " -cpu phenom "
|
|
if {[expr $use_usb]} {
|
|
append qemu_args " -usbdevice mouse -usbdevice keyboard"
|
|
}
|
|
}
|
|
|
|
run_genode_until forever
|