2017-06-30 11:30:37 +00:00
|
|
|
if {![have_spec x86] || [have_spec linux]} {
|
|
|
|
puts "Platform is unsupported."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
build { app/driver_manager test/driver_manager lib/ld }
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
import_from_depot genodelabs/src/[base_src] \
|
|
|
|
genodelabs/pkg/drivers_managed-pc \
|
|
|
|
genodelabs/src/report_rom \
|
2017-11-08 14:15:24 +00:00
|
|
|
genodelabs/src/dynamic_rom \
|
2017-06-30 11:30:37 +00:00
|
|
|
genodelabs/src/init
|
|
|
|
|
|
|
|
install_config {
|
|
|
|
<config prio_levels="2">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<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>
|
|
|
|
<default caps="100"/>
|
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="report_rom">
|
|
|
|
<binary name="report_rom"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<policy label="test-driver_manager -> block_devices" report="drivers -> block_devices"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="drivers" caps="2500">
|
2017-11-07 10:28:50 +00:00
|
|
|
<resource name="RAM" quantum="64M" constrain_phys="yes"/>
|
2017-06-30 11:30:37 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
2018-04-27 14:16:31 +00:00
|
|
|
<service name="ROM" label_last="managed/input_filter">
|
|
|
|
<parent label="input_filter.config"/> </service>
|
|
|
|
<service name="ROM" label_last="numlock_remap">
|
|
|
|
<parent label="numlock_remap.config"/> </service>
|
2017-06-30 11:30:37 +00:00
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
2018-06-27 11:39:31 +00:00
|
|
|
<service name="ROM" label="capslock"> <child name="dynamic_rom"/> </service>
|
|
|
|
<service name="ROM" label="numlock"> <child name="dynamic_rom"/> </service>
|
|
|
|
<service name="ROM" label="system"> <child name="dynamic_rom"/> </service>
|
|
|
|
<service name="ROM" label="usb_policy"><child name="dynamic_rom"/> </service>
|
2017-12-14 10:37:46 +00:00
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
2017-06-30 11:30:37 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
<provides>
|
|
|
|
<service name="Input"/>
|
|
|
|
<service name="Framebuffer"/>
|
|
|
|
<service name="Block"/>
|
|
|
|
</provides>
|
|
|
|
</start>
|
|
|
|
|
2017-11-08 14:15:24 +00:00
|
|
|
<start name="dynamic_rom">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="capslock">
|
|
|
|
<inline> <capslock enabled="no"/> </inline>
|
|
|
|
<sleep milliseconds="500" />
|
|
|
|
<inline> <capslock enabled="yes"/> </inline>
|
|
|
|
<sleep milliseconds="500" />
|
|
|
|
</rom>
|
|
|
|
<rom name="numlock">
|
|
|
|
<inline> <numlock enabled="no"/> </inline>
|
|
|
|
<sleep milliseconds="1000" />
|
|
|
|
<inline> <numlock enabled="yes"/> </inline>
|
|
|
|
<sleep milliseconds="1000" />
|
|
|
|
</rom>
|
2017-12-14 10:37:46 +00:00
|
|
|
<rom name="system">
|
|
|
|
<inline> <system state=""/> </inline>
|
|
|
|
<sleep milliseconds="10000" />
|
|
|
|
</rom>
|
|
|
|
<rom name="numlock_remap">
|
|
|
|
<inline> <system state=""/> </inline>
|
|
|
|
<sleep milliseconds="10000" />
|
|
|
|
</rom>
|
2017-11-08 14:15:24 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2017-06-30 11:30:37 +00:00
|
|
|
<start name="test-driver_manager">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<config>
|
2018-06-27 11:38:34 +00:00
|
|
|
<check_ahci_block_device label="ahci-1" block_count="65536" block_size="512"
|
2017-06-30 11:30:37 +00:00
|
|
|
model="QEMU HARDDISK"/>
|
|
|
|
<check_input/>
|
|
|
|
<check_framebuffer/>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="block_devices"> <child name="report_rom"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
set fd [open [run_dir]/genode/fb_drv.config "w"]
|
|
|
|
puts $fd {
|
|
|
|
<config width="1024" height="768" buffered="yes"> <!-- used by VESA driver -->
|
|
|
|
<report connectors="yes"/>
|
|
|
|
<connector name="eDP-36" width="1920" height="1080" enabled="true"/>
|
|
|
|
</config>}
|
|
|
|
close $fd
|
|
|
|
|
2018-06-27 11:39:31 +00:00
|
|
|
set fd [open [run_dir]/genode/usb_policy "w"]
|
|
|
|
puts $fd {<usb/>}
|
|
|
|
close $fd
|
|
|
|
|
2017-06-30 11:30:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Override 'drivers.config' as supplied with the 'drivers_managed-pc' pkg
|
|
|
|
# with the (possibly modified) version found in the source tree. This avoids
|
|
|
|
# the need to re-create the pkg while testing modifications of this file.
|
|
|
|
#
|
|
|
|
file copy -force [genode_dir]/repos/gems/recipes/raw/drivers_managed-pc/drivers.config \
|
|
|
|
[run_dir]/genode/drivers.config
|
|
|
|
|
|
|
|
build_boot_image { driver_manager test-driver_manager ld.lib.so }
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build ext2 file-system images to be supplied to Qemu
|
|
|
|
#
|
|
|
|
if {[have_include "power_on/qemu"]} {
|
|
|
|
|
2018-06-19 17:55:04 +00:00
|
|
|
set mke2fs [installed_command mke2fs]
|
|
|
|
set dd [installed_command dd]
|
2017-06-30 11:30:37 +00:00
|
|
|
|
|
|
|
catch { exec $dd if=/dev/zero of=bin/hdd_disk.raw bs=1M count=32 }
|
|
|
|
catch { exec $mke2fs -F bin/hdd_disk.raw }
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Qemu opts for supplying hdd_disk.raw as AHCI disk
|
|
|
|
#
|
|
|
|
append qemu_args " -m 128 "
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
append qemu_args " -device ahci,id=ahci "
|
2018-06-27 11:38:34 +00:00
|
|
|
append qemu_args " -drive id=hdd,file=bin/hdd_disk.raw,format=raw,if=none -device ide-hd,drive=hdd,bus=ahci.1 "
|
2017-06-30 11:30:37 +00:00
|
|
|
|
|
|
|
run_genode_until {.*all expected devices present and accessible.*\n} 120
|
|
|
|
|