2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
# \brief Example for using Vancouver on Genode
|
|
|
|
# \author Norman Feske
|
2012-10-10 17:23:26 +00:00
|
|
|
# \author Markus Partheymueller
|
2011-12-22 15:19:25 +00:00
|
|
|
# \date 2011-11-21
|
|
|
|
#
|
|
|
|
# This run script starts the Vancouver VMM booting the multiboot modules
|
|
|
|
# listed in the 'multiboot' config node. It assumes that the module files
|
|
|
|
# are present at '<build-dir>/bin/' (see the 'boot_modules' variable).
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
|
|
|
if {![have_spec nova]} {
|
|
|
|
puts "\nVancouver is only supported on NOVA\n"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
set build_components {
|
|
|
|
core init
|
|
|
|
drivers/timer
|
2012-10-10 17:23:26 +00:00
|
|
|
drivers/rtc
|
2011-12-22 15:19:25 +00:00
|
|
|
vancouver
|
2012-10-10 17:23:26 +00:00
|
|
|
drivers/framebuffer
|
|
|
|
server/nitpicker
|
|
|
|
server/liquid_framebuffer
|
|
|
|
drivers/nic
|
|
|
|
server/nic_bridge
|
|
|
|
drivers/pci
|
|
|
|
drivers/input
|
|
|
|
app/launchpad
|
|
|
|
server/nitlog
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
|
|
|
|
2013-02-27 16:27:33 +00:00
|
|
|
lappend_if [have_spec acpi] build_components drivers/acpi
|
|
|
|
lappend_if [have_spec pci] build_components drivers/pci/device_pd
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build $build_components
|
|
|
|
|
2012-10-10 17:23:26 +00:00
|
|
|
# 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>
|
2013-03-04 03:10:57 +00:00
|
|
|
<width>800</width>
|
|
|
|
<height>600</height>
|
2012-10-10 17:23:26 +00:00
|
|
|
</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
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
|
|
|
append config {
|
2012-10-10 17:23:26 +00:00
|
|
|
<config verbose="yes">
|
2011-12-22 15:19:25 +00:00
|
|
|
<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"/>
|
2012-10-10 17:23:26 +00:00
|
|
|
<service name="SIGNAL"/>
|
2011-12-22 15:19:25 +00:00
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2012-10-10 17:23:26 +00:00
|
|
|
</default-route>
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2012-10-10 17:23:26 +00:00
|
|
|
|
|
|
|
<start name="rtc_drv">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Rtc"/></provides>
|
2013-02-27 16:27:33 +00:00
|
|
|
</start>}
|
|
|
|
|
|
|
|
append_if [have_spec acpi] config {
|
|
|
|
<start name="acpi">
|
|
|
|
<resource name="RAM" quantum="5M"/>
|
|
|
|
<binary name="acpi_drv"/>
|
|
|
|
<provides>
|
|
|
|
<service name="PCI"/>
|
|
|
|
<service name="IRQ" />
|
|
|
|
</provides>
|
|
|
|
<route>
|
|
|
|
<service name="PCI"> <any-child /> </service>
|
|
|
|
<any-service> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-02-27 16:27:33 +00:00
|
|
|
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
|
2012-10-10 17:23:26 +00:00
|
|
|
<start name="pci_drv">
|
|
|
|
<resource name="RAM" quantum="3M"/>
|
|
|
|
<provides><service name="PCI"/></provides>
|
|
|
|
<route> <any-service><parent/></any-service> </route>
|
|
|
|
</start>
|
2013-02-27 16:27:33 +00:00
|
|
|
}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-02-27 16:27:33 +00:00
|
|
|
append config {
|
2012-10-10 17:23:26 +00:00
|
|
|
<start name="nic_drv">
|
|
|
|
<resource name="RAM" quantum="3M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<route> <any-service><any-child/><parent/></any-service> </route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_bridge">
|
|
|
|
<resource name="RAM" quantum="3M"/>
|
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"><child name="nic_drv"/></service>
|
|
|
|
<any-service><parent/></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2013-04-29 08:51:27 +00:00
|
|
|
<start name="fb_drv">
|
2012-10-10 17:23:26 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<provides><service name="Framebuffer"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"><child name="timer"/></service>
|
|
|
|
<service name="PCI"><any-child/></service>
|
|
|
|
<any-service><parent/></any-service>
|
|
|
|
</route>
|
|
|
|
<config width="1024" height="768" depth="16" buffered="no"/>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="ps2_drv">
|
|
|
|
<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>
|
2013-04-29 08:51:27 +00:00
|
|
|
<service name="Framebuffer"><child name="fb_drv"/></service>
|
2012-10-10 17:23:26 +00:00
|
|
|
<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>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
|
|
|
core init
|
2013-04-29 08:51:27 +00:00
|
|
|
fb_drv
|
2012-10-10 17:23:26 +00:00
|
|
|
nitpicker
|
|
|
|
liquid_fb
|
|
|
|
ps2_drv
|
|
|
|
pci_drv
|
|
|
|
nic_drv
|
|
|
|
nic_bridge
|
2011-12-22 15:19:25 +00:00
|
|
|
timer
|
2012-10-10 17:23:26 +00:00
|
|
|
rtc_drv
|
2011-12-22 15:19:25 +00:00
|
|
|
vancouver
|
2012-10-10 17:23:26 +00:00
|
|
|
launchpad
|
|
|
|
launchpad-config
|
|
|
|
nitlog
|
|
|
|
vm_linux.cfg
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
|
|
|
|
2013-02-27 16:27:33 +00:00
|
|
|
lappend_if [have_spec acpi] boot_modules acpi_drv
|
|
|
|
lappend_if [have_spec nova] boot_modules pci_device_pd
|
|
|
|
|
2012-10-10 17:23:26 +00:00
|
|
|
set guest_os_binaries { munich bzImage ramdisk }
|
|
|
|
|
|
|
|
set guest_os_binary_missing 0
|
|
|
|
foreach binary $guest_os_binaries {
|
|
|
|
if {![file exists bin/$binary]} {
|
|
|
|
puts stderr "Error: guest OS binary \"bin/$binary\" does not exist"
|
|
|
|
set guest_os_binary_missing 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if {$guest_os_binary_missing} { exit 1 }
|
|
|
|
|
|
|
|
append boot_modules $guest_os_binaries
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
append qemu_args " -m 256 "
|
2012-10-10 17:23:26 +00:00
|
|
|
append qemu_args " -cpu phenom "
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|