2013-03-21 10:40:55 +00:00
|
|
|
#
|
|
|
|
# \brief Example for using the terminal_mux server over UART
|
|
|
|
# \author Norman Feske
|
|
|
|
# \date 2013-02-20
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# On Linux, we don't have a UART driver, on which this run script depends.
|
|
|
|
#
|
|
|
|
if {[have_spec linux]} { puts "Run script does not support Linux"; exit 0 }
|
|
|
|
|
2013-02-21 10:44:46 +00:00
|
|
|
set build_components {
|
2013-03-21 10:40:55 +00:00
|
|
|
core init noux/minimal lib/libc_noux app/cli_monitor test/bomb test/signal
|
2013-10-05 17:07:34 +00:00
|
|
|
test/resource_yield drivers/timer drivers/uart server/terminal_mux
|
|
|
|
server/terminal_log noux-pkg/vim
|
2013-02-21 10:44:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build $build_components
|
|
|
|
|
|
|
|
exec tar cfv bin/vim.tar -h -C bin/vim .
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
append config {
|
2013-03-21 14:50:32 +00:00
|
|
|
<config>
|
2013-02-21 10:44:46 +00:00
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RAM"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <any-child/> <parent/> </any-service>
|
|
|
|
</default-route>
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
<route> <any-service> <parent/> </any-service> </route>
|
|
|
|
</start>
|
2013-03-21 14:50:32 +00:00
|
|
|
<start name="uart_drv">}
|
|
|
|
|
|
|
|
# use kernel debugger as UART on Fiasco.OC
|
|
|
|
append_if [have_spec foc] config {
|
|
|
|
<binary name="kdb_uart_drv"/>}
|
|
|
|
|
|
|
|
append config {
|
2013-02-21 10:44:46 +00:00
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Uart"/>
|
|
|
|
<service name="Terminal"/>
|
|
|
|
</provides>
|
2013-03-21 14:50:32 +00:00
|
|
|
<config> }
|
|
|
|
|
|
|
|
# on Fiasco.OC the kdb_uart_drv is always UART 0
|
|
|
|
append_if [have_spec foc] config {
|
|
|
|
<policy label="terminal_mux" uart="0" detect_size="yes"/> }
|
|
|
|
|
|
|
|
# on all other kernels, direct terminal_mux to UART 1 (Qemu stdio, see below)
|
|
|
|
append_if [expr ![have_spec foc]] config {
|
|
|
|
<policy label="terminal_mux" uart="1" detect_size="yes"/> }
|
|
|
|
|
|
|
|
append config {
|
2013-02-21 10:44:46 +00:00
|
|
|
</config>
|
2013-03-22 20:32:16 +00:00
|
|
|
<route> <any-service> <parent/> <any-child/> </any-service> </route>
|
2013-02-21 10:44:46 +00:00
|
|
|
</start>
|
|
|
|
<start name="terminal_mux">
|
2013-03-18 15:07:29 +00:00
|
|
|
<resource name="RAM" quantum="4M"/>
|
2013-02-21 10:44:46 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Terminal"/>
|
|
|
|
</provides>
|
|
|
|
<route>
|
|
|
|
<any-service> <child name="uart_drv" /> <parent/> <any-child /> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
<start name="terminal_log">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</provides>
|
|
|
|
<route>
|
2013-10-05 16:01:54 +00:00
|
|
|
<any-service> <child name="terminal_mux" /> <parent/> <any-child/> </any-service>
|
2013-02-21 10:44:46 +00:00
|
|
|
</route>
|
|
|
|
</start>
|
2013-03-21 10:40:55 +00:00
|
|
|
<start name="cli_monitor">
|
2013-10-14 12:41:39 +00:00
|
|
|
<resource name="RAM" quantum="100M"/>
|
2013-02-21 10:44:46 +00:00
|
|
|
<config>
|
2013-10-14 12:41:39 +00:00
|
|
|
<preservation name="RAM" quantum="16M" />
|
2016-02-09 07:01:40 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="subsystems">
|
|
|
|
<inline name="noux.subsystem">
|
|
|
|
<subsystem name="noux" help="VIM executed in the noux runtime">
|
|
|
|
<resource name="RAM" quantum="16M" />
|
|
|
|
<config>
|
|
|
|
<fstab> <tar name="vim.tar" /> </fstab>
|
|
|
|
<start name="/bin/vim">
|
|
|
|
<env name="TERM" value="linux" />
|
|
|
|
|
|
|
|
<!-- Deactivate the loading of plugins. Otherwise, vim will
|
|
|
|
attempt to use a sub shell for pattern matching -->
|
|
|
|
<arg value="--noplugin" />
|
|
|
|
|
|
|
|
<!-- Do not use swap file. Any attempt to create of would
|
|
|
|
fail because we are on a read-only file system -->
|
|
|
|
<arg value="-n" />
|
|
|
|
|
|
|
|
<!-- Use the nocompatible mode, which is much nicer than
|
|
|
|
the plain vi mode -->
|
|
|
|
<arg value="-N" />
|
|
|
|
|
|
|
|
<!-- Permanently display status bar -->
|
|
|
|
<arg value="--cmd" />
|
|
|
|
<arg value="set laststatus=2" />
|
|
|
|
|
|
|
|
<!-- Enable highlighted search results -->
|
|
|
|
<arg value="--cmd" />
|
|
|
|
<arg value="set hls" />
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
</subsystem>
|
|
|
|
</inline>
|
|
|
|
<inline name="ram_eater.subsystem">
|
|
|
|
<subsystem name="ram_eater" help="resource-yield test program">
|
|
|
|
<resource name="RAM" quantum="25M" />
|
|
|
|
<binary name="test-resource_yield" />
|
|
|
|
<config child="yes" expand="yes" period_ms="100" />
|
|
|
|
</subsystem>
|
|
|
|
</inline>
|
|
|
|
<inline name="signal.subsystem">
|
|
|
|
<subsystem name="signal" help="signalling test program">
|
|
|
|
<resource name="RAM" quantum="5M" />
|
|
|
|
<binary name="test-signal" />
|
|
|
|
</subsystem>
|
|
|
|
</inline>
|
|
|
|
</dir>
|
|
|
|
</vfs>
|
2013-02-21 10:44:46 +00:00
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<any-service> <child name="terminal_mux" /> <any-child/> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
|
|
|
# generic modules
|
|
|
|
set boot_modules {
|
2013-04-05 13:08:10 +00:00
|
|
|
core init timer ld.lib.so noux terminal_mux terminal_log
|
2013-10-05 17:07:34 +00:00
|
|
|
test-signal cli_monitor test-resource_yield
|
2013-02-21 10:44:46 +00:00
|
|
|
libc.lib.so libm.lib.so libc_noux.lib.so libc_terminal.lib.so ncurses.lib.so
|
|
|
|
vim.tar
|
|
|
|
}
|
|
|
|
|
2013-04-05 13:08:10 +00:00
|
|
|
lappend_if [expr ![have_spec foc]] boot_modules uart_drv
|
|
|
|
lappend_if [have_spec foc] boot_modules kdb_uart_drv
|
2013-03-21 14:50:32 +00:00
|
|
|
|
|
|
|
set fiasco_serial_esc_arg ""
|
|
|
|
|
2013-02-21 10:44:46 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
append qemu_args " -m 256 "
|
2013-03-21 14:50:32 +00:00
|
|
|
append qemu_args " -nographic "
|
|
|
|
|
|
|
|
#
|
|
|
|
# On Fiasco.OC, we use only one UART via the kernel debugger.
|
|
|
|
# On all other kernels, we write the core debug output to the kdb.log file,
|
|
|
|
# and use qemu's stdio as the UART used by terminal_mux.
|
|
|
|
#
|
|
|
|
append_if [expr ![have_spec foc]] qemu_args " -serial file:kdb.log "
|
|
|
|
append qemu_args " -serial mon:stdio"
|
2013-02-21 10:44:46 +00:00
|
|
|
|
|
|
|
run_genode_until forever
|
|
|
|
|
|
|
|
exec rm bin/vim.tar
|