genode/ports-foc/run/l4linux.run

200 lines
5.1 KiB
Plaintext
Raw Normal View History

2011-12-22 15:19:25 +00:00
assert_spec foc
assert_spec 32bit
2011-12-22 15:19:25 +00:00
#
# Build
#
set build_components {
core
init
drivers/timer
drivers/uart
drivers/framebuffer
l4linux }
set use_usb_driver [expr [have_spec omap4] || [have_spec exynos5]]
set use_nic_driver [expr !$use_usb_driver && [expr [have_spec lan9118] || [have_spec x86]]]
set use_platform_drv [expr [have_spec platform_arndale] || [have_spec platform_imx53]]
lappend_if $use_usb_driver build_components drivers/usb
lappend_if $use_nic_driver build_components drivers/nic
2011-12-22 15:19:25 +00:00
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec acpi] build_components drivers/acpi
2011-12-22 15:19:25 +00:00
lappend_if [have_spec ps2] build_components drivers/input/ps2
lappend_if $use_platform_drv build_components drivers/platform
lappend_if [have_spec gpio] build_components drivers/gpio
2011-12-22 15:19:25 +00:00
build $build_components
create_boot_directory
#
# Config
#
set config {
<config prio_levels="2">
<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"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="kdb_uart_drv">
2011-12-22 15:19:25 +00:00
<resource name="RAM" quantum="1M"/>
<provides>
<service name="Terminal"/>
<service name="Uart"/>
</provides>
<config><policy label="l4linux" uart="0"/></config>
2011-12-22 15:19:25 +00:00
</start> }
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M"/>
<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> }
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
2011-12-22 15:19:25 +00:00
<start name="pci_drv">
<resource name="RAM" quantum="3M"/>
<provides> <service name="PCI"/> </provides>
</start> }
2011-12-22 15:19:25 +00:00
append_if [have_spec framebuffer] config {
<start name="fb_drv">
<resource name="RAM" quantum="4M"/>
2011-12-22 15:19:25 +00:00
<provides><service name="Framebuffer"/></provides>
</start> }
append_if [have_spec ps2] config {
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start> }
2011-12-22 15:19:25 +00:00
append_if $use_platform_drv config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides>
<service name="Regulator"/>
</provides>
</start>}
append_if [have_spec gpio] config {
<start name="gpio_drv">
<resource name="RAM" quantum="4M"/>
<provides><service name="Gpio"/></provides>
<config/>
</start>}
append_if $use_usb_driver config {
<start name="usb_drv">
<resource name="RAM" quantum="12M"/>
<provides>
<service name="Nic"/>
<service name="Input"/>
</provides>
<config uhci="yes" ehci="yes">
<nic mac="2e:60:90:0c:4e:01"/>
<hid />
</config>
</start>}
2011-12-22 15:19:25 +00:00
append_if $use_nic_driver config {
2011-12-22 15:19:25 +00:00
<start name="nic_drv">
<resource name="RAM" quantum="2M"/>
2011-12-22 15:19:25 +00:00
<provides><service name="Nic"/></provides>
</start> }
append config {
<start name="l4linux">
<resource name="RAM" quantum="128M"/> }
append_if [have_spec x86] config {
<config args="mem=64M l4x_rd=initrd.gz l4x_cpus=2 l4x_cpus_map=0,1"/> }
append_if [have_spec arm] config {
<config args="mem=64M l4x_rd=initrd.gz"/> }
append config {
2011-12-22 15:19:25 +00:00
</start>
</config> }
2011-12-22 15:19:25 +00:00
install_config $config
#
# Boot modules
#
set boot_modules { core init timer kdb_uart_drv l4linux initrd.gz }
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if $use_nic_driver boot_modules nic_drv
lappend_if $use_usb_driver boot_modules usb_drv
lappend_if $use_platform_drv boot_modules platform_drv
lappend_if [have_spec gpio] boot_modules gpio_drv
2011-12-22 15:19:25 +00:00
if {[have_spec x86]} {
set uri "http://genode.org/files/release-11.11/l4lx/initrd-ia32.gz"
} elseif {[have_spec arm]} {
set uri "http://genode.org/files/release-11.11/l4lx/initrd-arm.gz"
}
if {![file exists bin/initrd.gz]} {
puts "Download initramfs ..."
exec >& /dev/null wget -c -O bin/initrd.gz $uri
}
exec >& /dev/null wget -O bin/initrd.gz.md5 $uri.md5
cd bin
exec md5sum -c initrd.gz.md5
cd ..
2011-12-22 15:19:25 +00:00
build_boot_image [join $boot_modules " "]
#
# Qemu
#
append qemu_args " -m 128 -nographic "
append qemu_args " -serial mon:stdio "
append_if [have_spec x86] qemu_args " -smp 2,cores=2 "
2011-12-22 15:19:25 +00:00
append_if [have_spec x86] qemu_args " -net nic,model=e1000 -net user "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 -net user "
#
# Execute test case
#
2013-02-13 11:52:34 +00:00
run_genode_until {.*\/ #.*} 220
2011-12-22 15:19:25 +00:00
# Wait for network to settle down
send "sleep 5\n"
send "wget http://genode.org/\n"
expect {
-re "Connecting to genode.org.*index.html.*\/ #.*" { }
timeout { puts stderr "Error: Test execution timed out"; exit -2 }
}
puts "Test succeeded"
exec rm bin/initrd.gz bin/initrd.gz.md5