Commit Graph

686 Commits

Author SHA1 Message Date
Norman Feske
3315294f2d Deprecate Genode::config()
Issue #1959
2017-01-13 13:06:54 +01:00
Norman Feske
a360452a10 base: remove platform.mk and syscall.mk
The purpose of those libraries is now covered by the kernel-specific
syscall-<kernel> libraries.
2017-01-13 13:06:53 +01:00
Norman Feske
4da52517c1 Simpify startup of dynamically linked binaries
This patch removes the component_entry_point library, which used to
proved a hook for the libc to intercept the call of the
'Component::construct' function. The mechansim has several shortcomings
(see the discussion in the associated issue) and was complex. So we
eventually discarded the approach in favor of the explicit handling of
the startup.

A regular Genode component provides a 'Component::construct' function,
which is determined by the dynamic linker via a symbol lookup.
For the time being, the dynamic linker falls back to looking up a 'main'
function if no 'Component::construct' function could be found.

The libc provides an implementation of 'Component::construct', which
sets up the libc's task handling and finally call the function
'Libc::Component::construct' from the context of the appllication task.
This function is expected to be provided by the libc-using application.
Consequently, Genode components that use the libc have to implement the
'Libc::Component::construct' function.

The new 'posix' library provides an implementation of
'Libc::Component::construct' that calls a main function. Hence, POSIX
programs that merely use the POSIX API merely have to add 'posix' to the
'LIBS' declaration in their 'target.mk' file. Their execution starts at
'main'.

Issue #2199
2017-01-13 13:06:52 +01:00
Martin Stein
8d521036fb IPv4: fix buggy ascii_to implementations
Ref #2193
2017-01-13 13:05:47 +01:00
Martin Stein
045a30865a NIC router: read Strings also with attribute_value
Ref #2193
2017-01-13 13:05:46 +01:00
Martin Stein
cd708b24db IPv4: treat 0.0.0.0/0 as valid IPv4 prefix
0.0.0.0/x is now only seen as invalid if x > 0.

Ref #2193
2017-01-13 13:05:46 +01:00
Alexander Boettcher
e3ca4de4d8 os: add testcase for bomb/init on several CPUs
Test case to trigger assertion as reported in #2198.
2017-01-13 13:05:45 +01:00
Christian Helmuth
f2568856dd Hide implementation details in timeout framework
Fixes #2205
2017-01-13 13:05:45 +01:00
Martin Stein
591ed80dcf NIC router: hand-over XML nodes by value
Ref #2193
2016-12-23 16:52:10 +01:00
Martin Stein
eef18e1ecd net: introduce and apply Net::Port type
Thereby fix bug in the NIC router that previously used uint8_t values for ports in
some places.

Ref #2193
2016-12-23 16:52:10 +01:00
Martin Stein
27cc0a402a NIC router: descriptive error on missing interface
Previously, if a packet should be routed to a domain that had no interface
connected, the NIC router only printed "Unroutable packet". Technically,
this was wrong as an unavailable interface doesn't mean that the routing
failed. Now it gives an error "no interface connected to domain".

Ref #2193
2016-12-23 16:52:10 +01:00
Sebastian Sumpf
ff0f1ebafc os: adapt pci test to component API
* also add pci.run

Fixes #2201
2016-12-23 16:52:09 +01:00
Alexander Boettcher
be5ae4dffa mention PIT in x86 platform_driver README
Issue #1578
2016-12-23 16:52:09 +01:00
Emery Hemingway
088bf52be1 drivers/framebuffer/sdl: emulate a 60Hz sampling rate
Set timer signaling only if a valid signal context is registered.

Ref #2192
2016-12-23 16:52:08 +01:00
Emery Hemingway
98cb37b9e4 drivers/timer: do not submit signals for invalid contexts
Setting a timer signal handler with an invalid capability cancels
signaling and any periodic timeout.

Fix #2192
2016-12-23 16:52:08 +01:00
Norman Feske
0d295f75a1 base: apply routing policy to environment sessions
This patch changes the child-construction procedure to allow the routing
of environment sessions to arbitrary servers, not only to the parent.
In particular, it restores the ability to route the LOG session of the
child to a LOG service provided by a child of init. In principle, it
becomes possible to also route the immediate child's PD, CPU, and RAM
environment sessions in arbitrary ways, which simplifies scenarios that
intercept those sessions, e.g., the CPU sampler.

Note that the latter ability should be used with great caution because
init needs to interact with these sessions to create/destruct the child.
Normally, the sessions are provided by the parent. So init is safe at
all times. If they are routed to a child however, init will naturally
become dependent on this particular child. For the LOG session, this is
actually not a problem because even though the parent creates the LOG
session as part of the child's environment, it never interacts with the
session directly.

Fixes #2197
2016-12-23 16:52:08 +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
44df8db771 Disambiguate names of timer drivers
Issue #2190
2016-12-23 16:50:33 +01:00
Alexander Boettcher
d8f2610e9c bomb: drop sleep_forever and signal_receiver 2016-12-14 11:22:29 +01:00
Norman Feske
dda054aa27 os: fix null termination in fb connection 2016-12-14 11:22:28 +01:00
Josef Söntgen
400198013b alarm: limit sleep timeout to 60s
Instead of using an unreasonable value for the sleep time, limit it to
60s.

Fixes #2188.
2016-12-14 11:22:27 +01:00
Norman Feske
ccffbb0dfc Build dynamically linked executables by default
Fixes #2184
2016-12-14 11:22:27 +01:00
Norman Feske
25a7ea3d40 base: rename 'Volatile_object' to 'Reconstructible'
Fixes #2151
2016-12-01 17:46:50 +01:00
Christian Helmuth
53271d8c5f Use default component stack size where appropriate 2016-11-30 13:38:06 +01:00
Martin Stein
7eabe482b6 Increase RAM quota for Nic::Connection
At least on foc_x86_64, nic_router refused to create sessions for the
test clients as the session object's size exceeds the old quota
donation.

Ref #2139
2016-11-30 13:38:06 +01:00
Alexander Boettcher
a090c9047d vfs: handle alloc failed in block_file_system
Fixes #2154
2016-11-30 13:38:06 +01:00
Martin Stein
89085096d2 nic_router: new user interface and optimizations
Fixes #2139
2016-11-30 13:38:05 +01:00
Martin Stein
4eea2a058d net: let Net_address and Ipv4_address be packed
Ref #2139
2016-11-30 13:38:05 +01:00
Martin Stein
4281471a34 net: replace dump.h by modern print methods
Ref #2139
2016-11-30 13:38:05 +01:00
Martin Stein
da925b9cd7 net/ipv4: Ipv4_address_prefix::prefix_matches
The new method checks whether a given IPv4 address matches the IPv4
address prefix.

Ref #2139
2016-11-30 13:38:04 +01:00
Martin Stein
6276daecab net/ipv4: convenience methods valid() and print()
Both methods are now available for Ipv4_address as well as for
Ipv4_address_prefix. An IPv4 address is invalid if it contains zeros only.
An IPv4 address prefix is invalid if its address is invalid and its
prefix is 32.

Ref #2139
2016-11-30 13:38:04 +01:00
Martin Stein
b85fa1d069 timer: move to the new timeout framework
Ref #2170
2016-11-30 13:38:04 +01:00
Martin Stein
791138ee63 os: introduce and test timeout framework
Ref #2170
2016-11-30 13:38:04 +01:00
Norman Feske
6a24d70120 Fix clang compile errors
Thanks Keiko Nakata for reporting!

Fixes #2164
2016-11-30 13:37:07 +01:00
Norman Feske
5a1cef6381 Make label prefixing more strict
This patch unconditionally applies the labeling of sessions and thereby
removes the most common use case of 'Child_policy::filter_session_args'.
Furthermore, the patch removes an ambiguity of the session labels of
sessions created by the parent of behalf of its child, e.g., the PD
session created as part of 'Child' now has the label "<child-name>"
whereas an unlabeled PD-session request originating from the child
has the label "<child-name> -> ". This way, the routing-policy of
'Child_policy::resolve_session_request' can differentiate both cases.

As a consequence, the stricter labeling must now be considered wherever
a precise label was specified as a key for a session route or a server-
side policy selection. The simplest way to adapt those cases is to use a
'label_prefix' instead of the 'label' attribute. Alternatively, the
'label' attribute may used by appending " -> " (note the whitespace).

Fixes #2171
2016-11-30 13:37:07 +01:00
Christian Helmuth
f184118930 vfs: support label attribute in log file system
The log plugin can now be configured to request a log session with the
specified label like follows.

  <log label="..."/>

Per default, no new log session is requested but the existing log
session of the component's environment is used.
2016-11-30 13:37:07 +01:00
Alexander Boettcher
ac2061abfe ps2: handle platform session memory requests
Issue #1039
2016-11-30 13:37:07 +01:00
Alexander Boettcher
6e66e51088 platform_drv: use ram_session_guard
Issue #1039
2016-11-30 13:37:06 +01:00
Alexander Boettcher
e32b78d95d os: extend ram_session_guard for platform_driver
Issue #1039
2016-11-30 13:37:06 +01:00
Alexander Boettcher
dffc1b0497 os: move ram_session_guard from nic_bridge to os
Issue #1039
2016-11-30 13:37:06 +01:00
Emery Hemingway
f1fc94cfbd app/rom_logger: base API transition, hexdump output
Ref #1987
2016-11-30 13:37:04 +01:00
Christian Helmuth
00adca8c47 lx_fs: use component API
Issue #1987
2016-11-30 13:37:03 +01:00
Norman Feske
b44f0554bd Adapt high-level components to new parent API
This patch adjusts the various users of the 'Child' API to the changes
on the account of the new non-blocking parent interface. It also removes
the use of the no-longer-available 'Connection::KEEP_OPEN' feature.

With the adjustment, we took the opportunity to redesign several
components to fit the non-blocking execution model much better, in
particular the demo applications.

Issue #2120
2016-11-30 13:37:03 +01:00
Norman Feske
8bafb9d41b Adapt low-level components to new parent interface
This patch adjusts the components of the os repository as well as device
drivers to the new parent interface.

Issue #2120
2016-11-25 16:06:42 +01:00
Norman Feske
cfdbccc5c2 Remove blocking calls from root and parent RPCs
This is a redesign of the root and parent interfaces to eliminate
blocking RPC calls.

- New session representation at the parent (base/session_state.h)
- base-internal root proxy mechanism as migration path
- Redesign of base/service.h
- Removes ancient 'Connection::KEEP_OPEN' feature
- Interface change of 'Child', 'Child_policy', 'Slave', 'Slave_policy'
- New 'Slave::Connection'
- Changed child-construction procedure to be compatible with the
  non-blocking parent interface and to be easier to use
- The child's initial LOG session, its binary ROM session, and the
  linker ROM session have become part of the child's envirenment.
- Session upgrading must now be performed via 'env.upgrade' instead
  of performing a sole RPC call the parent. To make RAM upgrades
  easier, the 'Connection' provides a new 'upgrade_ram' method.

Issue #2120
2016-11-25 16:06:42 +01:00
Alexander Boettcher
a72f81472b platform_drv: use label of client for ram session 2016-11-25 15:30:58 +01:00
Alexander Boettcher
57949c2bbb nova: support asynchronous delegate
Issue #2173
2016-11-25 15:30:57 +01:00
Christian Helmuth
ff5d28822c bomb: limit generations on Linux
Limit the number of generations to 4 to prevent hitting the
socket-descriptor limit on Linux. Also, all possible configuration
parameters for bomb our now customizable in the run script and the
current config is logged by bomb master.
2016-11-25 15:27:29 +01:00
Norman Feske
82107bef9b base: buffer session args in 'Connection'
This patch is a preparation of the forthcoming async parent interface.
Note that this patch increases the size of connection objects.
Furthermore it adds a diagnostic message whenever a connection fails.

Issue #2166
2016-11-25 15:27:28 +01:00
Norman Feske
7fba39831a platform_drv/x86: remove device slab
Because of the session-argument buffering added to 'Connection' objects
when changing the parent interface to be non-blocking, the
'Device_component' has grown in size from 1.5 KiB to 5 KiB. The slab
allocator was configured with a block size of 4 KiB. So it does not work
with the grown 'Device_component' size.

Once the transition to the new API is completed (when we can remove the
buffering of session arguments from the 'Connection' objects), we may
revert this change.

Issue #2120
2016-11-25 15:27:27 +01:00