2011-12-22 15:19:25 +00:00
|
|
|
#
|
2013-06-03 10:05:29 +00:00
|
|
|
# \brief Using Vancouver/Seoul on Genode
|
2011-12-22 15:19:25 +00:00
|
|
|
# \author Norman Feske
|
2012-10-10 17:23:26 +00:00
|
|
|
# \author Markus Partheymueller
|
2013-06-03 10:05:29 +00:00
|
|
|
# \author Alexander Boettcher
|
2011-12-22 15:19:25 +00:00
|
|
|
# \date 2011-11-21
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
|
|
|
if {![have_spec nova]} {
|
2013-06-03 10:05:29 +00:00
|
|
|
puts "\nSeoul is solely supported on NOVA.\n"
|
2011-12-22 15:19:25 +00:00
|
|
|
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/pci
|
|
|
|
drivers/input
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
|
|
|
|
2013-08-21 10:01:00 +00:00
|
|
|
if {$use_fancy_stuff} { set use_framebuffer 1 }
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
lappend_if [have_spec acpi] build_components drivers/acpi
|
|
|
|
lappend_if [have_spec pci] build_components drivers/pci/device_pd
|
|
|
|
lappend_if $use_usb build_components drivers/usb
|
|
|
|
lappend_if $use_block_ide build_components drivers/atapi
|
|
|
|
lappend_if $use_block_sata build_components drivers/ahci
|
|
|
|
lappend_if $use_nic_session build_components drivers/nic
|
|
|
|
lappend_if $use_nic_bridge build_components server/nic_bridge
|
2013-08-21 10:01:00 +00:00
|
|
|
lappend_if $use_framebuffer build_components drivers/framebuffer
|
2013-06-03 10:05:29 +00:00
|
|
|
lappend_if $use_fancy_stuff build_components server/nitpicker
|
|
|
|
lappend_if $use_fancy_stuff build_components server/liquid_framebuffer
|
|
|
|
lappend_if $use_fancy_stuff build_components app/launchpad
|
|
|
|
lappend_if $use_fancy_stuff build_components server/nitlog
|
2013-02-27 16:27:33 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build $build_components
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
# write Seoul config file
|
2012-10-10 17:23:26 +00:00
|
|
|
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"/>
|
2013-06-03 10:05:29 +00:00
|
|
|
<vga io_base="0x03c0" fb_size="4096" readonly="1"/>}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
if {!$use_multiboot} {
|
|
|
|
puts $vm_cfg_fd {
|
2012-10-10 17:23:26 +00:00
|
|
|
<vbios_disk/>
|
2013-06-03 10:05:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
puts $vm_cfg_fd {
|
2012-10-10 17:23:26 +00:00
|
|
|
<vbios_keyboard/>
|
|
|
|
<vbios_mem/>
|
|
|
|
<vbios_time/>
|
2013-06-03 10:05:29 +00:00
|
|
|
<vbios_reset/>}
|
|
|
|
|
|
|
|
if {$use_multiboot} {
|
|
|
|
puts $vm_cfg_fd {
|
2012-10-10 17:23:26 +00:00
|
|
|
<vbios_multiboot/>
|
2013-06-03 10:05:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
puts $vm_cfg_fd {
|
2012-10-10 17:23:26 +00:00
|
|
|
<msi/>
|
|
|
|
<ioapic/>
|
|
|
|
<pcihostbridge bus_num="0" bus_count="0x10" io_base="0xcf8"
|
|
|
|
mem_base="0xe0000000"/>
|
|
|
|
<pmtimer io_port="0x8000"/>
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
<vcpu/> <halifax/> <vbios/> <lapic/>}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
if {!$use_multiboot} {
|
|
|
|
puts $vm_cfg_fd {
|
|
|
|
<ahci mem="0xe0800000" irq="14" bdf="0x30"/>
|
|
|
|
<drive sigma0drive="0" controller="0" port="0"/>
|
|
|
|
}
|
|
|
|
}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
if {$use_nic_session} {
|
|
|
|
puts $vm_cfg_fd {
|
|
|
|
<intel82576vf/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
puts $vm_cfg_fd {
|
|
|
|
</machine>
|
|
|
|
<multiboot>}
|
|
|
|
|
|
|
|
if {$use_multiboot} {
|
|
|
|
puts $vm_cfg_fd $multiboot_files
|
|
|
|
}
|
|
|
|
|
|
|
|
puts $vm_cfg_fd {
|
|
|
|
</multiboot>
|
2012-10-10 17:23:26 +00:00
|
|
|
</config>}
|
2013-06-03 10:05:29 +00:00
|
|
|
close $vm_cfg_fd
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
2013-06-03 10:05:29 +00:00
|
|
|
# Generate Genode config
|
2011-12-22 15:19:25 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
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>}
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
append_if [expr !$use_usb] config {
|
|
|
|
<start name="ps2_drv">
|
|
|
|
<resource name="RAM" quantum="3M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
|
|
|
<route> <any-service><parent/></any-service> </route>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append_if $use_block_sata config {
|
|
|
|
<start name="ahci">
|
|
|
|
<resource name="RAM" quantum="1M" />
|
|
|
|
<provides><service name="Block"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
|
|
|
append_if $use_block_ide config {
|
|
|
|
<start name="atapi_drv">
|
|
|
|
<resource name="RAM" quantum="1M" />
|
|
|
|
<provides><service name="Block"/></provides>
|
|
|
|
<config ata="yes" />
|
|
|
|
</start>}
|
|
|
|
|
2013-02-27 16:27:33 +00:00
|
|
|
append_if [have_spec acpi] config {
|
|
|
|
<start name="acpi">
|
2013-06-03 10:05:29 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2013-02-27 16:27:33 +00:00
|
|
|
<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-06-03 10:05:29 +00:00
|
|
|
append_if $use_nic_session 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>
|
2013-06-03 10:05:29 +00:00
|
|
|
}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
append_if [expr $use_nic_session && $use_nic_bridge] config {
|
2012-10-10 17:23:26 +00:00
|
|
|
<start name="nic_bridge">
|
2013-09-05 10:12:33 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2012-10-10 17:23:26 +00:00
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"><child name="nic_drv"/></service>
|
|
|
|
<any-service><parent/></any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
2013-06-03 10:05:29 +00:00
|
|
|
}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-08-21 10:01:00 +00:00
|
|
|
append_if $use_framebuffer config {
|
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>
|
2013-06-03 10:05:29 +00:00
|
|
|
<config width="1024" height="768" depth="16" buffered="yes"/>
|
|
|
|
</start> }
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
if {!$use_fancy_stuff} {
|
|
|
|
append config {
|
|
|
|
<start name="vancouver">
|
2013-08-10 12:05:59 +00:00
|
|
|
<binary name="vancouver"/>}
|
|
|
|
append config "
|
|
|
|
<resource name=\"RAM\" quantum=\"$memory_vmm_vm\"/>"
|
|
|
|
append config {
|
2013-06-03 10:05:29 +00:00
|
|
|
<route>
|
|
|
|
<service name="Timer"><child name="timer"/></service>}
|
|
|
|
append_if [expr $use_nic_session && $use_nic_bridge] config {
|
|
|
|
<service name="Nic"> <child name="nic_bridge"/> </service>}
|
|
|
|
append_if [expr $use_nic_session && !$use_nic_bridge] config {
|
|
|
|
<service name="Nic"> <child name="nic_drv"/> </service>}
|
2013-08-21 10:01:00 +00:00
|
|
|
append_if $use_framebuffer config {
|
|
|
|
<service name="Framebuffer"><child name="fb_drv"/></service>}
|
2013-06-03 10:05:29 +00:00
|
|
|
append config {
|
|
|
|
<service name="Rtc"><child name="rtc_drv"/></service>
|
|
|
|
<any-service><parent/><any-child/></any-service>
|
|
|
|
</route>
|
|
|
|
<configfile name="vm_linux.cfg"/>
|
|
|
|
</start> }
|
|
|
|
}
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-08-10 12:05:59 +00:00
|
|
|
append_if $use_usb config {
|
|
|
|
<start name="usb_drv">
|
|
|
|
<resource name="RAM" quantum="7M"/>
|
|
|
|
<provides><service name="Input"/></provides>
|
|
|
|
<config uhci="yes" ehci="yes" xhci="yes">
|
|
|
|
<hid/>
|
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
append_if $use_fancy_stuff config {
|
2012-10-10 17:23:26 +00:00
|
|
|
<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>
|
2013-06-03 10:05:29 +00:00
|
|
|
<any-service><parent/><any-child/></any-service>
|
2012-10-10 17:23:26 +00:00
|
|
|
</route>
|
|
|
|
<provides><service name="Nitpicker"/></provides>
|
|
|
|
</start>
|
|
|
|
<start name="launchpad">
|
2013-08-10 12:05:59 +00:00
|
|
|
<resource name="RAM" quantum="64000M"/>
|
2012-10-10 17:23:26 +00:00
|
|
|
<configfile name="launchpad-config"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"><child name="nic_bridge"/></service>
|
|
|
|
<any-service><any-child/><parent/></any-service>
|
|
|
|
</route>
|
2013-06-03 10:05:29 +00:00
|
|
|
</start>}
|
|
|
|
|
|
|
|
append config {
|
|
|
|
</config>}
|
|
|
|
|
2013-08-10 12:05:59 +00:00
|
|
|
#
|
2013-06-03 10:05:29 +00:00
|
|
|
# Generate Launchpad config file
|
2013-08-10 12:05:59 +00:00
|
|
|
#
|
|
|
|
if {$use_fancy_stuff} {
|
|
|
|
set launchpad_cfg_fd [open "bin/launchpad-config" w]
|
|
|
|
|
|
|
|
puts $launchpad_cfg_fd "<config>
|
2013-09-19 13:07:28 +00:00
|
|
|
<launcher ram_quota=\"$memory_init\" name=\"init\">"
|
2013-08-10 12:05:59 +00:00
|
|
|
|
|
|
|
puts $launchpad_cfg_fd {
|
2013-06-03 10:05:29 +00:00
|
|
|
<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 xpos="10" ypos="10" width="800" height="600" animate="off"/>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="vancouver">
|
|
|
|
<binary name="vancouver"/>
|
|
|
|
<resource name="RAM" quantum="256M"/>
|
|
|
|
<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>
|
2013-08-10 12:05:59 +00:00
|
|
|
</launcher>}
|
|
|
|
puts $launchpad_cfg_fd {</config>}
|
|
|
|
close $launchpad_cfg_fd
|
|
|
|
}
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
|
|
|
core init
|
2012-10-10 17:23:26 +00:00
|
|
|
pci_drv
|
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
|
|
|
vm_linux.cfg
|
2011-12-22 15:19:25 +00:00
|
|
|
}
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
lappend_if [have_spec acpi] boot_modules acpi_drv
|
|
|
|
lappend_if [have_spec nova] boot_modules pci_device_pd
|
|
|
|
lappend_if [expr !$use_usb] boot_modules ps2_drv
|
|
|
|
lappend_if $use_usb boot_modules usb_drv
|
|
|
|
lappend_if $use_block_ide boot_modules atapi_drv
|
|
|
|
lappend_if $use_block_sata boot_modules ahci
|
|
|
|
lappend_if $use_nic_session boot_modules nic_drv
|
|
|
|
lappend_if $use_nic_bridge boot_modules nic_bridge
|
2013-08-21 10:01:00 +00:00
|
|
|
lappend_if $use_framebuffer boot_modules fb_drv
|
2013-06-03 10:05:29 +00:00
|
|
|
lappend_if $use_fancy_stuff boot_modules nitpicker
|
|
|
|
lappend_if $use_fancy_stuff boot_modules liquid_fb
|
|
|
|
lappend_if $use_fancy_stuff boot_modules launchpad
|
|
|
|
lappend_if $use_fancy_stuff boot_modules nitlog
|
|
|
|
lappend_if $use_fancy_stuff boot_modules launchpad-config
|
2013-02-27 16:27:33 +00:00
|
|
|
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
#
|
|
|
|
# Add OS binaries of guest
|
|
|
|
#
|
|
|
|
|
|
|
|
if {$use_multiboot} {
|
|
|
|
set guest_os_binary_missing 0
|
2013-08-10 12:05:59 +00:00
|
|
|
set binary_counter 0
|
2013-06-03 10:05:29 +00:00
|
|
|
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
|
|
|
|
}
|
2013-08-10 12:05:59 +00:00
|
|
|
|
|
|
|
set sha1 [exec sha1sum bin/$binary]
|
|
|
|
set sha1 [regexp -inline {[0-9a-h]+} $sha1]
|
|
|
|
if {[string compare $sha1 [lindex $sha1_os_binaries $binary_counter]]} {
|
|
|
|
puts "SHA1 sum of binary does not match with expected one - abort"
|
|
|
|
puts "$binary $sha1 != [lindex $sha1_os_binaries $binary_counter]"
|
|
|
|
set guest_os_binary_missing 1
|
|
|
|
}
|
|
|
|
incr binary_counter 1
|
2012-10-10 17:23:26 +00:00
|
|
|
}
|
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
if {$guest_os_binary_missing} { exit 1 }
|
2012-10-10 17:23:26 +00:00
|
|
|
|
2013-06-03 10:05:29 +00:00
|
|
|
append boot_modules $guest_os_binaries
|
|
|
|
}
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-08-10 12:05:59 +00:00
|
|
|
if {$use_usb} {
|
|
|
|
append qemu_args " -usb -usbdevice mouse -usbdevice keyboard "
|
|
|
|
}
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build_boot_image $boot_modules
|
2013-08-20 07:58:38 +00:00
|
|
|
|
|
|
|
# A copy of the config is placed in the run folder.
|
|
|
|
exec rm -f bin/vm_linux.cfg
|