2019-04-29 13:24:37 +00:00
|
|
|
assert_spec x86
|
2016-01-06 13:43:21 +00:00
|
|
|
set usb_raw_device ""
|
|
|
|
|
2014-12-17 15:16:36 +00:00
|
|
|
#
|
|
|
|
# Check if USB_RAW_DEVICE is set for Qemu
|
|
|
|
#
|
2016-01-06 13:43:21 +00:00
|
|
|
if {[have_include power_on/qemu]} {
|
|
|
|
if {![info exists ::env(USB_RAW_DEVICE)]} {
|
|
|
|
puts "\nPlease define USB_RAW_DEVICE environment variable and set it to your USB device <bus.device>\n"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
set usb_raw_device $::env(USB_RAW_DEVICE)
|
2014-12-17 15:16:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2021-06-04 09:51:05 +00:00
|
|
|
drivers/usb_host
|
2014-12-17 15:16:36 +00:00
|
|
|
server/usb_terminal
|
|
|
|
test/terminal_echo
|
|
|
|
}
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2014-12-17 15:16:36 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate config
|
|
|
|
#
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config>
|
|
|
|
<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>
|
2017-05-07 20:36:11 +00:00
|
|
|
</default-route>
|
|
|
|
<default caps="100"/>}
|
2014-12-17 15:16:36 +00:00
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_config
|
2014-12-17 15:16:36 +00:00
|
|
|
|
|
|
|
append config {
|
|
|
|
<start name="timer">
|
2017-01-03 13:57:18 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2014-12-17 15:16:36 +00:00
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
2021-06-04 09:51:05 +00:00
|
|
|
<start name="usb_drv" caps="120">
|
|
|
|
<binary name="} [usb_host_drv_binary] {"/>
|
2017-01-03 13:57:18 +00:00
|
|
|
<resource name="RAM" quantum="32M"/>
|
2014-12-17 15:16:36 +00:00
|
|
|
<provides><service name="Usb"/></provides>
|
2021-06-04 09:51:05 +00:00
|
|
|
<config>
|
|
|
|
<policy label="usb_terminal -> usb_serial" vendor_id="0x67b" product_id="0x2303"/>
|
2014-12-17 15:16:36 +00:00
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
<start name="usb_terminal">
|
2017-01-03 13:57:18 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2014-12-17 15:16:36 +00:00
|
|
|
<provides><service name="Terminal"/></provides>
|
|
|
|
</start>
|
|
|
|
<start name="test-terminal_echo">
|
2017-01-03 13:57:18 +00:00
|
|
|
<resource name="RAM" quantum="2M"/>
|
2014-12-17 15:16:36 +00:00
|
|
|
</start>
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2021-06-04 09:51:05 +00:00
|
|
|
core ld.lib.so init timer test-terminal_echo
|
2014-12-17 15:16:36 +00:00
|
|
|
usb_terminal
|
|
|
|
}
|
2021-06-04 09:51:05 +00:00
|
|
|
append boot_modules [usb_host_drv_binary]
|
2014-12-17 15:16:36 +00:00
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_boot_modules
|
|
|
|
|
2014-12-17 15:16:36 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args " -nographic -usb -usbdevice host:$usb_raw_device -nographic"
|
2014-12-17 15:16:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
run_genode_until forever
|