vancouver: run script for booting Linux VMs

The setup now uses nitpicker and nit_fb to display several instances of
vancouver. The guest OS binaries must be supplied in the
'<build-dir>/bin' directory manually.

Furthermore, the patch lets launchpad pass Block, Nic, and Rtc to the
parent.
This commit is contained in:
Markus Partheymueller 2012-10-10 19:23:26 +02:00 committed by Norman Feske
parent 3a533779e4
commit 47cc2f8590
2 changed files with 208 additions and 53 deletions

View File

@ -1,11 +1,13 @@
/* /*
* \brief Launchpad child management * \brief Launchpad child management
* \author Norman Feske * \author Norman Feske
* \author Markus Partheymueller
* \date 2006-09-01 * \date 2006-09-01
*/ */
/* /*
* Copyright (C) 2006-2013 Genode Labs GmbH * Copyright (C) 2006-2013 Genode Labs GmbH
* Copyright (C) 2012 Intel Corporation
* *
* This file is part of the Genode OS framework, which is distributed * This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2. * under the terms of the GNU General Public License version 2.
@ -43,8 +45,8 @@ Launchpad::Launchpad(unsigned long initial_quota)
"IRQ", "ROM", "LOG", "SIGNAL", "IRQ", "ROM", "LOG", "SIGNAL",
/* services expected to got started by init */ /* services expected to got started by init */
"Nitpicker", "Init", "Timer", "PCI", "Nitpicker", "Init", "Timer", "PCI", "Block", "Nic", "Rtc",
0 /* null-termination */ 0 /* null-termination */
}; };
for (unsigned i = 0; names[i]; i++) for (unsigned i = 0; names[i]; i++)

View File

@ -1,6 +1,7 @@
# #
# \brief Example for using Vancouver on Genode # \brief Example for using Vancouver on Genode
# \author Norman Feske # \author Norman Feske
# \author Markus Partheymueller
# \date 2011-11-21 # \date 2011-11-21
# #
# This run script starts the Vancouver VMM booting the multiboot modules # This run script starts the Vancouver VMM booting the multiboot modules
@ -20,11 +21,122 @@ if {![have_spec nova]} {
set build_components { set build_components {
core init core init
drivers/timer drivers/timer
drivers/rtc
vancouver vancouver
drivers/framebuffer
server/nitpicker
server/liquid_framebuffer
drivers/nic
server/nic_bridge
drivers/pci
drivers/input
drivers/usb
app/launchpad
server/nitlog
} }
build $build_components build $build_components
# write vancouver vm config file
set vm_cfg_fd [open "bin/vm_linux.cfg" w]
puts $vm_cfg_fd {<config>
<machine>
<mem start="0x0" end="0x9a000"/>
<mem start="0x100000" end="0xfffff000"/>
<!--<ioio/>-->
<nullio io_base="0x80" />
<pic io_base="0x20" elcr_base="0x4d0"/>
<pic io_base="0xa0" irq="2" elcr_base="0x4d1"/>
<pit io_base="0x40" irq="0"/>
<scp io_port_a="0x92" io_port_b="0x61"/>
<kbc io_base="0x60" irq_kbd="1" irq_aux="12"/>
<keyb ps2_port="0" host_keyboard="0x10000"/>
<mouse ps2_port="1" host_mouse="0x10001"/>
<rtc io_base="0x70" irq="8"/>
<serial io_base="0x3f8" irq="0x4" host_serial="0x4711"/>
<hostsink host_dev="0x4712" buffer="80"/>
<vga io_base="0x03c0" fb_size="4096" readonly="1"/>
<vbios_disk/>
<vbios_keyboard/>
<vbios_mem/>
<vbios_time/>
<vbios_reset/>
<vbios_multiboot/>
<msi/>
<ioapic/>
<pcihostbridge bus_num="0" bus_count="0x10" io_base="0xcf8"
mem_base="0xe0000000"/>
<pmtimer io_port="0x8000"/>
<vcpu/> <halifax/> <vbios/> <lapic/>
</machine>
<multiboot>
<rom name="munich"/>
<rom name="bzImage" cmdline="root=/dev/ram0 console=tty0 vga=0x314 earlyprintk=ttyS0"/>
<rom name="ramdisk"/>
</multiboot>
</config>}
close $vm_cfg_fd
# write launchpad config file
set launchpad_cfg_fd [open "bin/launchpad-config" w]
puts $launchpad_cfg_fd {<config>
<launcher><ram_quota>128M</ram_quota><filename>init</filename>
<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"/>
<service name="Nitpicker"/>
<service name="Timer"/>
<service name="Nic"/>
<service name="Block"/>
<service name="Rtc"/>
</parent-provides>
<start name="vancouver_fb">
<binary name="liquid_fb"/>
<resource name="RAM" quantum="16M"/>
<provides>
<service name="Framebuffer"/>
<service name="Input"/>
</provides>
<route>
<any-service><parent/></any-service>
</route>
<config>
<animate>off</animate>
<x>10</x><y>10</y>
<width>640</width>
<height>480</height>
</config>
</start>
<start name="vancouver">
<binary name="vancouver"/>
<resource name="RAM" quantum="64M"/>
<route>
<service name="Timer"><parent/></service>
<service name="Nic"><parent/></service>
<service name="Input"><child name="vancouver_fb"/></service>
<service name="Framebuffer"><child name="vancouver_fb"/></service>
<any-service><parent/></any-service>
</route>
<configfile name="vm_linux.cfg"/>
</start>
</config>
</launcher>
</config>}
close $launchpad_cfg_fd
create_boot_directory create_boot_directory
# #
@ -32,7 +144,7 @@ create_boot_directory
# #
append config { append config {
<config> <config verbose="yes">
<parent-provides> <parent-provides>
<service name="ROM"/> <service name="ROM"/>
<service name="RAM"/> <service name="RAM"/>
@ -44,56 +156,78 @@ append config {
<service name="RM"/> <service name="RM"/>
<service name="CPU"/> <service name="CPU"/>
<service name="LOG"/> <service name="LOG"/>
<service name="SIGNAL"/>
</parent-provides> </parent-provides>
<default-route> <default-route>
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</default-route>} </default-route>
append config {
<start name="timer"> <start name="timer">
<resource name="RAM" quantum="1M"/> <resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides> <provides><service name="Timer"/></provides>
</start> </start>
<start name="vancouver">
<binary name="vancouver"/> <start name="rtc_drv">
<resource name="RAM" quantum="65M"/> <resource name="RAM" quantum="1M"/>
<config> <provides><service name="Rtc"/></provides>
<machine> </start>
<mem start="0x0" end="0xa0000"/>
<mem start="0x100000" end="0x2000000"/> <start name="pci_drv">
<!--<ioio/>--> <resource name="RAM" quantum="3M"/>
<nullio io_base="0x80" /> <provides><service name="PCI"/></provides>
<pic io_base="0x20" elcr_base="0x4d0"/> <route> <any-service><parent/></any-service> </route>
<pic io_base="0xa0" irq="2" elcr_base="0x4d1"/> </start>
<pit io_base="0x40" irq="0"/>
<scp io_port_a="0x92" io_port_b="0x61"/> <start name="nic_drv">
<kbc io_base="0x60" irq_kbd="1" irq_aux="12"/> <resource name="RAM" quantum="3M"/>
<keyb ps2_port="0" host_keyboard="0x10000"/> <provides><service name="Nic"/></provides>
<mouse ps2_port="1" host_mouse="0x10001"/> <route> <any-service><any-child/><parent/></any-service> </route>
<rtc io_base="0x70" irq="8"/> </start>
<serial io_base="0x3f8" irq="0x4" host_serial="0x4711"/>
<hostsink host_dev="0x4712" buffer="80"/> <start name="nic_bridge">
<vga io_base="0x03c0"/> <resource name="RAM" quantum="3M"/>
<vbios_disk/> <provides><service name="Nic"/></provides>
<vbios_keyboard/> <route>
<vbios_mem/> <service name="Nic"><child name="nic_drv"/></service>
<vbios_time/> <any-service><parent/></any-service>
<vbios_reset/> </route>
<vbios_multiboot/> </start>
<msi/>
<ioapic/> <start name="vesa_drv">
<pcihostbridge bus_num="0" bus_count="0x10" io_base="0xcf8" <resource name="RAM" quantum="8M"/>
mem_base="0xe0000000"/> <provides><service name="Framebuffer"/></provides>
<pmtimer io_port="0x8000"/> <route>
<vcpu/> <halifax/> <vbios/> <lapic/> <service name="Timer"><child name="timer"/></service>
</machine> <service name="PCI"><any-child/></service>
<multiboot> <any-service><parent/></any-service>
<rom name="bootstrap"/> </route>
<rom name="fiasco"/> <config width="1024" height="768" depth="16" buffered="no"/>
<rom name="sigma0.foc"/> </start>
<rom name="core.foc"/>
</multiboot> <start name="ps2_drv">
</config> <resource name="RAM" quantum="3M"/>
<provides><service name="Input"/></provides>
<route> <any-service><parent/></any-service> </route>
</start>
<start name="nitpicker">
<resource name="RAM" quantum="8M"/>
<route>
<service name="Timer"> <child name="timer"/></service>
<service name="Framebuffer"><child name="vesa_drv"/></service>
<service name="Input"> <child name="ps2_drv"/></service>
<any-service><parent/></any-service>
</route>
<provides><service name="Nitpicker"/></provides>
</start>
<start name="launchpad">
<resource name="RAM" quantum="2500M"/>
<configfile name="launchpad-config"/>
<route>
<service name="Nic"><child name="nic_bridge"/></service>
<any-service><any-child/><parent/></any-service>
</route>
</start> </start>
</config>} </config>}
@ -106,21 +240,40 @@ install_config $config
# generic modules # generic modules
set boot_modules { set boot_modules {
core init core init
vesa_drv
nitpicker
liquid_fb
ps2_drv
pci_drv
nic_drv
nic_bridge
usb_drv
timer timer
rtc_drv
vancouver vancouver
launchpad
launchpad-config
nitlog
vm_linux.cfg
} }
# set guest_os_binaries { munich bzImage ramdisk }
# Add files for a simple Fiasco.OC setup to core's ROM service
# set guest_os_binary_missing 0
# The files are copied from a Genode build directory for the Fiasco.OC base foreach binary $guest_os_binaries {
# platform. if {![file exists bin/$binary]} {
# puts stderr "Error: guest OS binary \"bin/$binary\" does not exist"
append boot_modules { bootstrap fiasco sigma0.foc core.foc } set guest_os_binary_missing 1
}
}
if {$guest_os_binary_missing} { exit 1 }
append boot_modules $guest_os_binaries
build_boot_image $boot_modules build_boot_image $boot_modules
append qemu_args " -m 256 " append qemu_args " -m 256 "
append qemu_args " -nographic " append qemu_args " -cpu phenom "
run_genode_until forever run_genode_until forever