Commit Graph

34 Commits

Author SHA1 Message Date
Ehmry - 24deef9495 Use #!/usr/bin/env ... shebangs 2019-11-28 15:07:24 +01:00
Christian Helmuth cf2c9f8d88 run: abort with error if BOARD was not set 2019-07-09 08:55:23 +02:00
Stefan Kalkowski a1e70b9ba4 kernel: differentiate board-specific components
Components like kernel, core, and bootstrap that are built for a
specific board need to reside inside the same architectural dependent
build directory. For instance there are sel4, foc, and hw kernel builds
for imx6q_sabrelite and imx7d_sabre, which have to reside inside the same
arm_v7 build directory.
This commit names those components explicitely, and adapts the run-tool to it.

Fix #3316
2019-05-27 14:46:52 +02:00
Josef Söntgen 1c0541e7cb run: add power cycle procedure
The 'run_genode_until' procedure only called 'run_power_on' to reset
the target machine. That works will with the softreset module, which
is used by all x86-based test system but falls short regarding ARM
boards. The way those boards are connected requires turning the power
off and on for a complete cycle.
2019-02-12 10:33:15 +01:00
Martin Stein d2a36c5958 base: define generic config XSD types globally
The new base/xsd/config.inc defines generic XSD types such as 'Boolean' or
'Session_label'. It can be included in config XSD files by using:

! <xs:include schemaLocation="file://${GENODE_CONFIG_INC}"/>

The string ${GENODE_CONFIG_INC} is replaced by the run tool with the
above mentionened file path.

Issue #2897
2018-08-28 16:48:47 +02:00
Sebastian Sumpf b6bc44fd10 run: add support to preserve 'genode' directory
Add '--preserve-genode-dir' to RUN_OPT in order to preserve the 'genode'
directory in '<build_dir>/var/run/<run-script>'
2018-08-02 14:36:46 +02:00
Sebastian Sumpf 10485b0d39 run: rename 'check_installed' to 'installed_command'
Also remove 'requires_installation_of', while also checking sbin
directories in 'have_installed'. The run scripts have been adjusted
accordingly.

Fixes #2853
2018-07-03 09:39:31 +02:00
Roman Iten 5d23ef9447 run: make run script fail on unmet dependencies
Fixes #2820
2018-05-30 13:36:15 +02:00
Martin Stein 75df14f190 run: use XSD files from depots too
Fix #2619
2017-12-21 15:01:55 +01:00
Martin Stein fb2398dbf2 run: target-specific config schemata
The run tool now by default checks configurations with target-specific
XML schemata. Each component may define a config schema file in its
target.mk via the CONFIG_XSD variable. When the run tool has checked an
configuration of an init instance, it additionally goes through the
start nodes of the config. For each start node it checks whether there
is an XSD file that matches. If so, the run tool also checks the config
of the start node (if existant). This is done recursively. I.e., also
the child configs of a sub-init of a sub-init of the top-level init
receive a config check.

Issue #2600
2017-12-21 15:01:36 +01:00
Stefan Kalkowski 7f5bec5c0d tool/run: link core with debug symbols optionally
If there is no debug/core-<kernel>.o library available, e.g., when
running a scenario in a fresh build directory where core is provided
via a depot package, the build_core_image step of the run tool was
canceled in the past, when trying to access the non-existing library.
This commit changes the semantic of build_core_image to link a core
binary with debug symbols only when the designated library is in place.

This fixup is related to issue #2339
2017-11-06 13:57:22 +01:00
Stefan Kalkowski 42db1e112b hw: introduce kernel/user address space split
* introduces central memory map for core/kernel
* on 32-bit platforms the kernel/core starts at 0x80000000
* on 64-bit platforms the kernel/core starts at 0xffffffc000000000
* mark kernel/core mappings as global ones (tagged TLB)
* move the exception vector to begin of core's binary,
  thereby bootstrap knows from where to map it appropriately
* do not map boot modules into core anymore
* constrain core's virtual heap memory area
* differentiate in between user's and core's main thread's UTCB,
  which now resides inside the kernel segment

Ref #2091
2017-10-19 13:31:17 +02:00
Alexander Boettcher be753ee863 tool: add genode xml schema to xmllint check
Fixes #2513
2017-10-05 17:40:03 +02:00
Norman Feske f04ef8ed40 run: align data after last boot module
In the image.elf file, the very last boot module is followed
by arbitrary other core-local data. Since those boot modules are
exported as page-granular dataspace to the outside of core via core's
ROM service, we need to ensure that the last page is padded with zeros.
2017-10-05 17:40:03 +02:00
Norman Feske 3e8c4ebde2 run: concatenate 'install_config' args
This patch enables one to supply a list of arguments to
'install_config'. The arguments appear concatenated in the resulting
config file. This is useful for embedding dynamically generated content
into an otherwise static configuration. For example, in the following
config, the 'pkg' attribute of the '<query>' config node is defined by
the return value of the 'query_pkg' function:

  install_config {
  <config>
    ...
    <start name="depot_query">
      ...
      <config>
        <query pkg="genodelabs/pkg/} [query_pkg] {"/>
      </config>
    </start>
  </config>}
2017-08-28 16:49:38 +02:00
Josef Söntgen 0dd9c6a018 run: add error checking to power on step 2017-08-17 11:04:24 +02:00
Martin Stein 228dbdd527 run + noux_gdb: fix source archiving
We do not have debug symbols in the bin/ binaries anymore. Thus, use the
debug/ binaries instead.  We now have kernel specific binary names for
ld.lib.so and some others. Adapt, to this fact as well.  For doing so
without unnecessary output, provide a new parameter "silent" at the
"kernel_specific_binary" procedure.

Ref #2398
2017-05-31 13:16:16 +02:00
Martin Stein 91a8c8975d run: provide core image with path information
Previously, the debugging version of the core image
(<build_dir>/var/run/<run_name>.core) was created by the run tool from
the common core object file
(<build_dir>/var/run/<run_name>/core-<kernel>.o). This object file,
however, was already stripped by the build system and thus didn't
contain debug info anymore. The build system also creates an unstripped
version in <build_dir>/debug/core-<kernel>.o, so we now use this one
for <build_dir>/var/run/<run_name>.core.

Ref #2254
2017-05-31 13:16:07 +02:00
Norman Feske 015d319fa7 run: link all files in [run_dir]/genode to core
This way, files copied from the depot are incorporated in addition to
the files explicitly specified as boot modules.

The patch also adds an automatic check for the validity of the XML
syntax of boot modules ending with '.config'.

Issue #2339
2017-05-31 13:15:56 +02:00
Norman Feske a196fc171a run: support for accessing depot content
Run scripts can use the new 'import_from_depot' function to incorporate
archive content from the depot into a scenario. The function must be
called after the 'create_boot_directory' function and takes any number
of pkg, src, or raw archives as arguments. An archive is specified as
depot-relative path of the form <user>/<type>/name. Run scripts may
call 'import_from_depot' repeatedly.

An argument can refer to a specific version of an archive or just the
version-less archive name. In the latter case, the current version (as
defined by a corresponding archive recipe in the source tree) is used.

If a 'src' archive is specified, the run tool integrates the content of
the corrsponding binary archive into the scenario. The binary archives
are selected according the spec values as defined for the build directory.
As of now, only x86_32 and x86_64 are supported by the 'depot_spec'
function.

Issue #2339
2017-05-31 13:15:56 +02:00
Norman Feske 8c4a2a48ca core: install core-<kernel>.o at bin/
By installing the core object to bin/, we follow the same convention as
for regular binaries. This, in turn, enables us to ship core in a
regular binary archive. The patch also adjusts the run tool to pick up
the core object from bin/ for the final linking stage.
2017-05-02 15:29:02 +02:00
Christian Helmuth 62e605325e run: support variable arguments in append_if
This enables to use append_if like the append command in the following
situation.

  proc optional_binary {} {...}

  append_if $optional config {
    <start name="} [optional_binary] {">
    ...
  }
2017-03-15 12:32:26 +01:00
Alexander Boettcher 54865fdd0f Provide copy of config file of a run scenario
Fixes #2213
2017-02-23 14:54:44 +01:00
Stefan Kalkowski bb10afa266 tool/run: define core link address explicitly
Instead of implicitly asking for core's link address when linking
core within the run tool, deliver it explicitly to the build_core
routine. Thereby we gain the freedom to use the build_core tool for
different targets like core, and bootstrap.

Ref #2092
2017-02-07 19:20:30 +01:00
Norman Feske 1e41c2dbe9 Remove redundant boot modules from boot image
Fixes #2185
2016-12-23 16:52:09 +01:00
Norman Feske c450ddcb3d Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.

Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.

As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.

This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.

Issue #2190
2016-12-23 16:51:32 +01:00
Norman Feske f54c85e045 Genode application binary interface (ABI)
This patch decouples the kernel-specific implementation of the dynamic
linker from its kernel-agnostic binary interface. The name of the
kernel-specific dynamic linker binary now corresponds to the kernel,
e.g., 'ld-linux.lib.so' or 'ld-nova.lib.so'. Applications are no longer
linked directly against a concrete instance of the dynamic linker but
against a shallow stub called 'ld.lib.so'. This stub contains nothing
but the symbols provided by the dynamic linker. It thereby represents
the Genode ABI.

At system-integration time, the kernel-specific run/boot_dir back ends
integrate the matching the kernel-specific variant of the dynamic linker
as 'ld.lib.so' into the boot image.

The ABI symbol file for the dynamic linker is located at
'base/lib/symbols/ld'. It contains the joint ABI of all supported
architectures. The new utility 'tool/abi_symbols' eases the creation of
such an ABI symbol file for a given shared library. Its result should be
manually inspected and edited as needed.

The patch removes the 'syscall' library from 'base_libs.mk' to avoid
polluting the kernel-agnostic ABI with kernel-specific interfaces.

Issue #2190
Issue #2195
2016-12-23 16:50:28 +01:00
Stefan Kalkowski 7e1692d997 core: unify handling of boot modules
Instead of solving the problem to deliver ROM modules to core while booting
differently for the several kernels (multi-boot, elfweaver, core re-linking),
this commit unifies the approaches. It always builds core as a library, and
after all binaries are built from a run-script, the run-tool will link an
ELF image out of the core-library and all boot modules. Thereby, core can
access its ROM modules directly.

This approach now works for all kernels except Linux.

With this solution, there is no [build_dir]/bin/core binary available anymore.
For debugging purposes you will find a core binary without boot modules, but
with debug symbols under [run_dir].core.

Fix #2095
2016-11-08 15:26:27 +01:00
Alexander Boettcher 115a605658 run: try to detect reboots of platform 2015-10-28 15:06:24 +01:00
Christian Helmuth ae61e520d7 run: fail if boot_dir module was not declared 2015-05-06 10:55:17 +02:00
Josef Söntgen e6cf426d72 run: always append to output buffer
On each execution the output buffer is overriden when run_genode_until
is executed multiple times. Run scripts, that depend on extracting
information after several execution steps, e.g. noux_net_netcat, will
fail to do so. Therefore, we append the newly captured log output to
the old output buffer.

Issue #1327.
2015-03-27 11:53:15 +01:00
Alexander Boettcher 467eee07a6 run: increase tcl buffer for run_genode_until
and move it close to run_genode_until implementation.
Somehow the "match_max -d" gets ignored if it is to far away and some
our run scripts fails because the buffer contains not all information
(seen for affinity.run on a 8 core machine)
2015-02-17 14:18:16 +01:00
Josef Söntgen 7617833365 run: capture kernel msg to detect boot errors
Handle boot errors like the old run tool did by checking a kernel
specific string on boot up and start the run script timeout afterwards.

Issue #1395.
2015-02-16 14:01:45 +01:00
Josef Söntgen c706b1c0a7 run: modularize run tool 2015-01-26 12:28:40 +01:00