2011-12-22 15:19:25 +00:00
|
|
|
assert_spec foc
|
2013-06-30 11:48:10 +00:00
|
|
|
assert_spec 32bit
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
set build_components {
|
|
|
|
core
|
|
|
|
init
|
|
|
|
drivers/timer
|
|
|
|
drivers/uart
|
|
|
|
drivers/framebuffer
|
|
|
|
l4linux }
|
|
|
|
|
2015-09-03 12:55:05 +00:00
|
|
|
set use_usb_driver [expr [have_spec omap4] || [have_spec arndale]]
|
2013-06-25 12:19:55 +00:00
|
|
|
set use_nic_driver [expr !$use_usb_driver && [expr [have_spec lan9118] || [have_spec x86]]]
|
2013-05-15 10:23:46 +00:00
|
|
|
|
2015-10-16 08:12:49 +00:00
|
|
|
if {[expr !$use_usb_driver && !$use_nic_driver]} {
|
|
|
|
puts "\n Run script is not supported on this platform. \n"; exit 0 }
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
lappend_if $use_usb_driver build_components drivers/usb
|
|
|
|
lappend_if $use_nic_driver build_components drivers/nic
|
2015-09-03 12:55:05 +00:00
|
|
|
lappend_if [have_spec ps2] build_components drivers/input/spec/ps2
|
2015-05-28 11:43:13 +00:00
|
|
|
lappend_if [have_spec gpio] build_components drivers/gpio
|
|
|
|
|
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
build $build_components
|
2015-05-28 11:43:13 +00:00
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
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="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</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>
|
2013-04-17 13:10:05 +00:00
|
|
|
<start name="kdb_uart_drv">
|
2011-12-22 15:19:25 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
2013-06-05 12:36:02 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Terminal"/>
|
|
|
|
<service name="Uart"/>
|
|
|
|
</provides>
|
2013-04-17 13:10:05 +00:00
|
|
|
<config><policy label="l4linux" uart="0"/></config>
|
2011-12-22 15:19:25 +00:00
|
|
|
</start> }
|
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_config
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-04-29 08:51:27 +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>
|
2013-04-17 13:10:05 +00:00
|
|
|
</start> }
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-11-13 13:10:49 +00:00
|
|
|
append_if [have_spec gpio] config {
|
|
|
|
<start name="gpio_drv">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="Gpio"/></provides>
|
|
|
|
<config/>
|
|
|
|
</start>}
|
|
|
|
|
2013-05-15 10:23:46 +00:00
|
|
|
append_if $use_usb_driver config {
|
|
|
|
<start name="usb_drv">
|
|
|
|
<resource name="RAM" quantum="12M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Input"/>
|
|
|
|
</provides>
|
2013-06-05 12:36:02 +00:00
|
|
|
<config uhci="yes" ehci="yes">
|
2014-04-22 09:50:56 +00:00
|
|
|
<nic mac="02:00:00:00:01:01"/>
|
2013-05-15 10:23:46 +00:00
|
|
|
<hid />
|
|
|
|
</config>
|
|
|
|
</start>}
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-05-15 10:23:46 +00:00
|
|
|
append_if $use_nic_driver config {
|
2011-12-22 15:19:25 +00:00
|
|
|
<start name="nic_drv">
|
2016-10-07 13:08:06 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2011-12-22 15:19:25 +00:00
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
</start> }
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<start name="l4linux">
|
2013-04-17 13:10:05 +00:00
|
|
|
<resource name="RAM" quantum="128M"/> }
|
2012-09-11 11:49:30 +00:00
|
|
|
|
|
|
|
append_if [have_spec x86] config {
|
2013-04-17 13:10:05 +00:00
|
|
|
<config args="mem=64M l4x_rd=initrd.gz l4x_cpus=2 l4x_cpus_map=0,1"/> }
|
2012-09-11 11:49:30 +00:00
|
|
|
|
|
|
|
append_if [have_spec arm] config {
|
2013-04-17 13:10:05 +00:00
|
|
|
<config args="mem=64M l4x_rd=initrd.gz"/> }
|
2012-09-11 11:49:30 +00:00
|
|
|
|
|
|
|
append config {
|
2011-12-22 15:19:25 +00:00
|
|
|
</start>
|
2013-04-17 13:10:05 +00:00
|
|
|
</config> }
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
2013-04-17 13:10:05 +00:00
|
|
|
set boot_modules { core init timer kdb_uart_drv l4linux initrd.gz }
|
2013-04-29 08:51:27 +00:00
|
|
|
lappend_if [have_spec ps2] boot_modules ps2_drv
|
|
|
|
lappend_if [have_spec framebuffer] boot_modules fb_drv
|
2013-05-15 10:23:46 +00:00
|
|
|
lappend_if $use_nic_driver boot_modules nic_drv
|
|
|
|
lappend_if $use_usb_driver boot_modules usb_drv
|
2013-11-13 13:10:49 +00:00
|
|
|
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
|
|
|
|
}
|
2013-07-01 09:22:59 +00:00
|
|
|
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
|
|
|
|
2015-05-28 11:43:13 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
2011-12-22 15:19:25 +00:00
|
|
|
build_boot_image [join $boot_modules " "]
|
|
|
|
|
|
|
|
#
|
|
|
|
# Qemu
|
|
|
|
#
|
2016-04-15 13:19:22 +00:00
|
|
|
append qemu_args " -m 160 -nographic "
|
2011-12-22 15:19:25 +00:00
|
|
|
append qemu_args " -serial mon:stdio "
|
2012-09-11 11:49:30 +00:00
|
|
|
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
|
2015-02-03 12:29:44 +00:00
|
|
|
set serial_id [output_spawn_id]
|
2011-12-22 15:19:25 +00:00
|
|
|
|
|
|
|
# Wait for network to settle down
|
2015-02-03 12:29:44 +00:00
|
|
|
send -i $serial_id "sleep 5\n"
|
|
|
|
send -i $serial_id "wget http://genode.org/\n"
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2015-02-03 12:29:44 +00:00
|
|
|
run_genode_until "Connecting to genode.org.*index.html.*\/ #.*" 30 $serial_id
|
2011-12-22 15:19:25 +00:00
|
|
|
|
2013-07-01 09:22:59 +00:00
|
|
|
exec rm bin/initrd.gz bin/initrd.gz.md5
|